|
From: <and...@us...> - 2013-06-06 21:44:36
|
Revision: 12372
http://sourceforge.net/p/plplot/code/12372
Author: andrewross
Date: 2013-06-06 21:44:33 +0000 (Thu, 06 Jun 2013)
Log Message:
-----------
Style recent changes.
Modified Paths:
--------------
trunk/bindings/c++/plstream.cc
trunk/bindings/java/PLStream.java
trunk/bindings/java/plplotjavac.i
trunk/bindings/octave/plplot_octave.h.in
trunk/bindings/octave/plplot_octave.i
trunk/bindings/python/plplot_widgetmodule.c
trunk/bindings/python/plplotcmodule.i
trunk/bindings/swig-support/plplotcapi.i
trunk/examples/c++/x15.cc
trunk/examples/c++/x16.cc
trunk/examples/c++/x33.cc
trunk/examples/java/x16.java
trunk/examples/java/x33.java
Modified: trunk/bindings/c++/plstream.cc
===================================================================
--- trunk/bindings/c++/plstream.cc 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/c++/plstream.cc 2013-06-06 21:44:33 UTC (rev 12372)
@@ -1398,7 +1398,7 @@
{
set_stream();
- plgcmap1_range( &min_color, &max_color);
+ plgcmap1_range( &min_color, &max_color );
}
// Set color map 0 colors by 8 bit RGB values
Modified: trunk/bindings/java/PLStream.java
===================================================================
--- trunk/bindings/java/PLStream.java 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/java/PLStream.java 2013-06-06 21:44:33 UTC (rev 12372)
@@ -555,28 +555,28 @@
}
- public void colorbar( double[] p_colorbar_width,
- double[] p_colorbar_height,
- int opt, int position, double x, double y,
- double x_length, double y_length,
- int bg_color, int bb_color, int bb_style,
- double low_cap_color, double high_cap_color,
- int cont_color, double cont_width,
- int[] label_opts, String[] labels,
- String[] axis_opts,
- double[] ticks, int[] sub_ticks,
- int[] n_values, double[][] values )
- {
- if ( set_stream() == -1 ) return;
- plplotjavac.plcolorbar( p_colorbar_width, p_colorbar_height,
- opt, position, x, y, x_length, y_length,
- bg_color, bb_color, bb_style,
- low_cap_color, high_cap_color,
- cont_color, cont_width,
- label_opts, labels, axis_opts,
- ticks, sub_ticks,
- n_values, values );
- }
+ public void colorbar( double[] p_colorbar_width,
+ double[] p_colorbar_height,
+ int opt, int position, double x, double y,
+ double x_length, double y_length,
+ int bg_color, int bb_color, int bb_style,
+ double low_cap_color, double high_cap_color,
+ int cont_color, double cont_width,
+ int[] label_opts, String[] labels,
+ String[] axis_opts,
+ double[] ticks, int[] sub_ticks,
+ int[] n_values, double[][] values )
+ {
+ if ( set_stream() == -1 ) return;
+ plplotjavac.plcolorbar( p_colorbar_width, p_colorbar_height,
+ opt, position, x, y, x_length, y_length,
+ bg_color, bb_color, bb_style,
+ low_cap_color, high_cap_color,
+ cont_color, cont_width,
+ label_opts, labels, axis_opts,
+ ticks, sub_ticks,
+ n_values, values );
+ }
public void lightsource( double x, double y, double z )
Modified: trunk/bindings/java/plplotjavac.i
===================================================================
--- trunk/bindings/java/plplotjavac.i 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/java/plplotjavac.i 2013-06-06 21:44:33 UTC (rev 12372)
@@ -582,17 +582,18 @@
// Set X and Y length for later consistency checking
%typemap( in ) const PLINT * ArrayN {
- int i;
+ int i;
jint *jydata = ( *jenv )->GetIntArrayElements( jenv, $input, 0 );
if ( ( *jenv )->GetArrayLength( jenv, $input ) != Alen )
{
- printf( "Vectors must be same length.\n" );
- return;
+ printf( "Vectors must be same length.\n" );
+ return;
}
Xlen = ( *jenv )->GetArrayLength( jenv, $input );
Ylen = -1;
- for ( i = 0; i < Xlen ; i++ )
- if (jydata[i] > Ylen) Ylen = jydata[i];
+ for ( i = 0; i < Xlen; i++ )
+ if ( jydata[i] > Ylen )
+ Ylen = jydata[i];
setup_array_1d_i( &$1, jydata, Alen );
( *jenv )->ReleaseIntArrayElements( jenv, $input, jydata, 0 );
}
@@ -1971,8 +1972,8 @@
{
int size = ( *jenv )->GetArrayLength( jenv, $input );
Alen = size;
- $1 = size;
- $2 = (char **) malloc( Alen * sizeof ( char * ) );
+ $1 = size;
+ $2 = (char **) malloc( Alen * sizeof ( char * ) );
// make a copy of each string
for ( i = 0; i < Alen; i++ )
{
Modified: trunk/bindings/octave/plplot_octave.h.in
===================================================================
--- trunk/bindings/octave/plplot_octave.h.in 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/octave/plplot_octave.h.in 2013-06-06 21:44:33 UTC (rev 12372)
@@ -1810,42 +1810,43 @@
} //%name plimagefr2 //%input a(nx,ny), xg(nx+1,ny+1), yg(nx+1,ny+1)
void plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
- PLINT opt, PLINT position, PLFLT x, PLFLT y,
- PLFLT x_length, PLFLT y_length,
- PLINT bg_color, PLINT bb_color, PLINT bb_style,
- PLFLT low_cap_color, PLFLT high_cap_color,
- PLINT cont_color, PLFLT cont_width,
- PLINT n_labels, const PLINT *label_opts, const char * const *label,
- PLINT n_axes, const char * const * axis_opts,
- const PLFLT *ticks, const PLINT *sub_ticks,
- const PLINT *n_values, const PLFLT * const *values ) // %nowrap
+ PLINT opt, PLINT position, PLFLT x, PLFLT y,
+ PLFLT x_length, PLFLT y_length,
+ PLINT bg_color, PLINT bb_color, PLINT bb_style,
+ PLFLT low_cap_color, PLFLT high_cap_color,
+ PLINT cont_color, PLFLT cont_width,
+ PLINT n_labels, const PLINT *label_opts, const char * const *label,
+ PLINT n_axes, const char * const * axis_opts,
+ const PLFLT *ticks, const PLINT *sub_ticks,
+ const PLINT *n_values, const PLFLT * const *values ) // %nowrap
void my_plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
- PLINT opt, PLINT position, PLFLT x, PLFLT y,
- PLFLT x_length, PLFLT y_length,
- PLINT bg_color, PLINT bb_color, PLINT bb_style,
- PLFLT low_cap_color, PLFLT high_cap_color,
- PLINT cont_color, PLFLT cont_width,
- PLINT n_labels, const PLINT *label_opts, const char * const *label,
- PLINT nx, const char * const * axis_opts,
- const PLFLT *ticks, const PLINT *sub_ticks,
- const PLINT *n_values, const PLFLT *a )
+ PLINT opt, PLINT position, PLFLT x, PLFLT y,
+ PLFLT x_length, PLFLT y_length,
+ PLINT bg_color, PLINT bb_color, PLINT bb_style,
+ PLFLT low_cap_color, PLFLT high_cap_color,
+ PLINT cont_color, PLFLT cont_width,
+ PLINT n_labels, const PLINT *label_opts, const char * const *label,
+ PLINT nx, const char * const * axis_opts,
+ const PLFLT *ticks, const PLINT *sub_ticks,
+ const PLINT *n_values, const PLFLT *a )
{
PLINT ny, i;
ny = -1;
- for ( i = 0; i < nx ; i++ )
- if ( n_values[i] < ny ) ny = n_values[i];
+ for ( i = 0; i < nx; i++ )
+ if ( n_values[i] < ny )
+ ny = n_values[i];
f2c( a, aa, nx, ny );
- c_plcolorbar(p_colorbar_width, p_colorbar_height,
- opt, position, x, y,
- x_length, y_length,
- bg_color, bb_color, bb_style,
- low_cap_color, high_cap_color,
- cont_color, cont_width,
- n_labels, label_opts, label,
- nx, axis_opts,
- ticks, sub_ticks,
- n_values, aa);
+ c_plcolorbar( p_colorbar_width, p_colorbar_height,
+ opt, position, x, y,
+ x_length, y_length,
+ bg_color, bb_color, bb_style,
+ low_cap_color, high_cap_color,
+ cont_color, cont_width,
+ n_labels, label_opts, label,
+ nx, axis_opts,
+ ticks, sub_ticks,
+ n_values, aa );
} //%name plcolorbar //%input a(nx,ny)
#ifdef __cplusplus
Modified: trunk/bindings/octave/plplot_octave.i
===================================================================
--- trunk/bindings/octave/plplot_octave.i 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/octave/plplot_octave.i 2013-06-06 21:44:33 UTC (rev 12372)
@@ -355,7 +355,8 @@
_cvt_double_to( $1, &temp( 0, 0 ), Alen );
Ylen = -1;
for ( i = 0; i < Xlen; i++ )
- if ( $1[i] > Ylen ) Ylen = $1[i];
+ if ( $1[i] > Ylen )
+ Ylen = $1[i];
}
%typemap( freearg ) ( const PLINT * ArrayN )
{
@@ -1024,7 +1025,8 @@
}
// No count but check consistency with previous
-%typemap( in ) (PLINT n, const char **Array) {
+%typemap( in ) ( PLINT n, const char **Array )
+{
charMatrix temp_matrix;
Cell temp_cell;
char *tmp_cstring;
@@ -1038,7 +1040,7 @@
if ( !$input.is_empty() )
{
Alen = _dim( $input, 0 );
- $1 = Alen;
+ $1 = Alen;
$2 = new char*[Alen];
ifcell = $input.is_cell();
if ( ifcell )
@@ -1117,7 +1119,8 @@
$2 = NULL;
}
}
-%typemap( freearg ) (PLINT n, const char **Array) {
+%typemap( freearg ) ( PLINT n, const char **Array )
+{
int i;
if ( $2 != NULL )
{
@@ -1784,46 +1787,47 @@
%{
void my_plcolorbar( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
- PLINT opt, PLINT position, PLFLT x, PLFLT y,
- PLFLT x_length, PLFLT y_length,
- PLINT bg_color, PLINT bb_color, PLINT bb_style,
- PLFLT low_cap_color, PLFLT high_cap_color,
- PLINT cont_color, PLFLT cont_width,
- PLINT n_labels, const PLINT *label_opts, const char **label,
- PLINT n_axes, const char ** axis_opts,
- const PLFLT *ticks, const PLINT *sub_ticks,
- const PLINT *n_values, const PLFLT *a )
+ PLINT opt, PLINT position, PLFLT x, PLFLT y,
+ PLFLT x_length, PLFLT y_length,
+ PLINT bg_color, PLINT bb_color, PLINT bb_style,
+ PLFLT low_cap_color, PLFLT high_cap_color,
+ PLINT cont_color, PLFLT cont_width,
+ PLINT n_labels, const PLINT *label_opts, const char **label,
+ PLINT n_axes, const char ** axis_opts,
+ const PLFLT *ticks, const PLINT *sub_ticks,
+ const PLINT *n_values, const PLFLT *a )
{
PLINT nx, ny, i;
- nx = n_axes;
- ny = -1;
- for ( i = 0; i < nx ; i++ )
- if ( n_values[i] > ny ) ny = n_values[i];
- f2c( a, aa, nx, ny );
- c_plcolorbar(p_colorbar_width, p_colorbar_height,
- opt, position, x, y,
- x_length, y_length,
- bg_color, bb_color, bb_style,
- low_cap_color, high_cap_color,
- cont_color, cont_width,
- n_labels, label_opts, label,
- n_axes, axis_opts,
- ticks, sub_ticks,
- n_values, aa);
+ nx = n_axes;
+ ny = -1;
+ for ( i = 0; i < nx; i++ )
+ if ( n_values[i] > ny )
+ ny = n_values[i];
+ f2c( a, aa, nx, ny );
+ c_plcolorbar( p_colorbar_width, p_colorbar_height,
+ opt, position, x, y,
+ x_length, y_length,
+ bg_color, bb_color, bb_style,
+ low_cap_color, high_cap_color,
+ cont_color, cont_width,
+ n_labels, label_opts, label,
+ n_axes, axis_opts,
+ ticks, sub_ticks,
+ n_values, aa );
}
%}
void my_plcolorbar( PLFLT *OUTPUT, PLFLT *OUTPUT,
- PLINT opt, PLINT position, PLFLT x, PLFLT y,
- PLFLT x_length, PLFLT y_length,
- PLINT bg_color, PLINT bb_color, PLINT bb_style,
- PLFLT low_cap_color, PLFLT high_cap_color,
- PLINT cont_color, PLFLT cont_width,
- PLINT n, const PLINT *Array, const char **ArrayCk,
- PLINT n, const char **Array,
- const PLFLT *ArrayCk, const PLINT *ArrayCk,
- const PLINT *ArrayN , const PLFLT *MatrixCk );
+ PLINT opt, PLINT position, PLFLT x, PLFLT y,
+ PLFLT x_length, PLFLT y_length,
+ PLINT bg_color, PLINT bb_color, PLINT bb_style,
+ PLFLT low_cap_color, PLFLT high_cap_color,
+ PLINT cont_color, PLFLT cont_width,
+ PLINT n, const PLINT *Array, const char **ArrayCk,
+ PLINT n, const char **Array,
+ const PLFLT *ArrayCk, const PLINT *ArrayCk,
+ const PLINT *ArrayN, const PLFLT *MatrixCk );
// Probably never deal with this one.
%ignore plMinMax2dGrid;
Modified: trunk/bindings/python/plplot_widgetmodule.c
===================================================================
--- trunk/bindings/python/plplot_widgetmodule.c 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/python/plplot_widgetmodule.c 2013-06-06 21:44:33 UTC (rev 12372)
@@ -1,6 +1,6 @@
// C code to create dynamically loaded library to implement plplot_widget module
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <Python.h>
#include <arrayobject.h>
#include "plplot.h"
Modified: trunk/bindings/python/plplotcmodule.i
===================================================================
--- trunk/bindings/python/plplotcmodule.i 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/python/plplotcmodule.i 2013-06-06 21:44:33 UTC (rev 12372)
@@ -45,7 +45,7 @@
%include typemaps.i
%{
-#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <arrayobject.h>
#include "plplot.h"
#include "plplotP.h"
@@ -143,8 +143,8 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- $1 = Alen = PyArray_DIMS(tmp)[0];
- $2 = (PLINT *) PyArray_DATA(tmp);
+ $1 = Alen = PyArray_DIMS( tmp )[0];
+ $2 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( PLINT n, const PLINT * Array )
{
@@ -157,13 +157,13 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $2 = PyArray_DIMS(tmp)[0];
- $1 = (PLINT *) PyArray_DATA(tmp);
+ $2 = PyArray_DIMS( tmp )[0];
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( const PLINT * ArrayCk, PLINT n )
{
@@ -176,12 +176,12 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLINT *) PyArray_DATA(tmp);
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLINT * ArrayCk { Py_DECREF( tmp$argnum );}
@@ -191,12 +191,12 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLINT *) PyArray_DATA(tmp);
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLINT * ArrayCkNull { Py_DECREF( tmp$argnum );}
@@ -206,12 +206,12 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] < Alen - 1 )
+ if ( PyArray_DIMS( tmp )[0] < Alen - 1 )
{
PyErr_SetString( PyExc_ValueError, "Vector must be at least length of others minus 1." );
return NULL;
}
- $1 = (PLINT *) PyArray_DATA(tmp);
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLINT * ArrayCkMinus1 { Py_DECREF( tmp$argnum );}
@@ -220,12 +220,12 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] < Alen - 1 )
+ if ( PyArray_DIMS( tmp )[0] < Alen - 1 )
{
PyErr_SetString( PyExc_ValueError, "Vector must be at least length of others minus 1." );
return NULL;
}
- $1 = (PLINT *) PyArray_DATA(tmp);
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLINT * ArrayCkMinus1Null { Py_DECREF( tmp$argnum );}
@@ -235,8 +235,8 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Alen = PyArray_DIMS(tmp)[0];
- $1 = (PLINT *) PyArray_DATA(tmp);
+ Alen = PyArray_DIMS( tmp )[0];
+ $1 = (PLINT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLINT * Array { Py_DECREF( tmp$argnum );}
@@ -247,16 +247,17 @@
tmp = (PyArrayObject *) myIntArray_ContiguousFromObject( $input, NPY_PLINT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- Xlen = PyArray_DIMS(tmp)[0];
- $1 = (PLINT *) PyArray_DATA(tmp);
+ Xlen = PyArray_DIMS( tmp )[0];
+ $1 = (PLINT *) PyArray_DATA( tmp );
Ylen = -1;
for ( i = 0; i < Xlen; i++ )
- if ( $1[i] > Ylen ) Ylen = $1[i];
+ if ( $1[i] > Ylen )
+ Ylen = $1[i];
}
%typemap( freearg ) const PLINT * ArrayN { Py_DECREF( tmp$argnum );}
@@ -297,8 +298,8 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- $1 = Alen = PyArray_DIMS(tmp)[0];
- $2 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = Alen = PyArray_DIMS( tmp )[0];
+ $2 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( PLINT n, const PLFLT * Array )
{
@@ -311,13 +312,13 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLFLT *) PyArray_DATA(tmp);
- $2 = PyArray_DIMS(tmp)[0];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
+ $2 = PyArray_DIMS( tmp )[0];
}
%typemap( freearg ) ( const PLFLT * ArrayCk, PLINT n )
{
@@ -330,12 +331,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayCk { Py_DECREF( tmp$argnum );}
@@ -345,12 +346,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayCkNull { Py_DECREF( tmp$argnum );}
@@ -360,12 +361,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Xlen )
+ if ( PyArray_DIMS( tmp )[0] != Xlen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayCkX { Py_DECREF( tmp$argnum );}
@@ -375,12 +376,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Ylen )
+ if ( PyArray_DIMS( tmp )[0] != Ylen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
}
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayCkY { Py_DECREF( tmp$argnum );}
@@ -390,9 +391,9 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Xlen = PyArray_DIMS(tmp)[0];
+ Xlen = PyArray_DIMS( tmp )[0];
$2 = Xlen;
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( const PLFLT * ArrayX, PLINT nx )
{
@@ -405,8 +406,8 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Xlen = PyArray_DIMS(tmp)[0];
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ Xlen = PyArray_DIMS( tmp )[0];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayX { Py_DECREF( tmp$argnum );}
@@ -416,9 +417,9 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Ylen = PyArray_DIMS(tmp)[0];
+ Ylen = PyArray_DIMS( tmp )[0];
$2 = Ylen;
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( const PLFLT * ArrayY, PLINT ny )
{
@@ -431,8 +432,8 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Ylen = PyArray_DIMS(tmp)[0];
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ Ylen = PyArray_DIMS( tmp )[0];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * ArrayY { Py_DECREF( tmp$argnum );}
@@ -443,8 +444,8 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- $2 = PyArray_DIMS(tmp)[0];
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $2 = PyArray_DIMS( tmp )[0];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( const PLFLT * Array, PLINT n )
{
@@ -457,8 +458,8 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Alen = PyArray_DIMS(tmp)[0];
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ Alen = PyArray_DIMS( tmp )[0];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) const PLFLT * Array { Py_DECREF( tmp$argnum );}
@@ -469,17 +470,17 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- if ( Xlen != PyArray_DIMS(tmp)[0] || Ylen != PyArray_DIMS(tmp)[1] )
+ if ( Xlen != PyArray_DIMS( tmp )[0] || Ylen != PyArray_DIMS( tmp )[1] )
{
PyErr_SetString( PyExc_ValueError, "Vectors must match matrix." );
return NULL;
}
- $2 = PyArray_DIMS(tmp)[0];
- $3 = PyArray_DIMS(tmp)[1];
+ $2 = PyArray_DIMS( tmp )[0];
+ $3 = PyArray_DIMS( tmp )[1];
size = sizeof ( PLFLT ) * $3;
$1 = (PLFLT **) malloc( sizeof ( PLFLT* ) * $2 );
for ( i = 0; i < $2; i++ )
- $1[i] = (PLFLT *) ( PyArray_DATA(tmp) + i * size );
+ $1[i] = (PLFLT *) ( PyArray_DATA( tmp ) + i * size );
}
%typemap( freearg ) ( const PLFLT * *MatrixCk, PLINT nx, PLINT ny )
{
@@ -494,12 +495,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- Xlen = $2 = PyArray_DIMS(tmp)[0];
- Ylen = $3 = PyArray_DIMS(tmp)[1];
+ Xlen = $2 = PyArray_DIMS( tmp )[0];
+ Ylen = $3 = PyArray_DIMS( tmp )[1];
size = sizeof ( PLFLT ) * $3;
$1 = (PLFLT **) malloc( sizeof ( PLFLT* ) * $2 );
for ( i = 0; i < $2; i++ )
- $1[i] = (PLFLT *) ( PyArray_DATA(tmp) + i * size );
+ $1[i] = (PLFLT *) ( PyArray_DATA( tmp ) + i * size );
}
%typemap( freearg ) ( const PLFLT * *Matrix, PLINT nx, PLINT ny )
{
@@ -514,12 +515,12 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- Xlen = PyArray_DIMS(tmp)[0];
- Ylen = PyArray_DIMS(tmp)[1];
+ Xlen = PyArray_DIMS( tmp )[0];
+ Ylen = PyArray_DIMS( tmp )[1];
size = sizeof ( PLFLT ) * Ylen;
$1 = (PLFLT **) malloc( sizeof ( PLFLT* ) * Xlen );
for ( i = 0; i < Xlen; i++ )
- $1[i] = (PLFLT *) ( PyArray_DATA(tmp) + i * size );
+ $1[i] = (PLFLT *) ( PyArray_DATA( tmp ) + i * size );
}
%typemap( freearg ) const PLFLT * *Matrix {
Py_DECREF( tmp$argnum );
@@ -532,9 +533,9 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- Xlen = $2 = PyArray_DIMS(tmp)[0];
- Ylen = $3 = PyArray_DIMS(tmp)[1];
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ Xlen = $2 = PyArray_DIMS( tmp )[0];
+ Ylen = $3 = PyArray_DIMS( tmp )[1];
+ $1 = (PLFLT *) PyArray_DATA( tmp );
}
%typemap( freearg ) ( const PLFLT * Matrix, PLINT nx, PLINT ny )
{
@@ -548,7 +549,7 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Xlen || PyArray_DIMS(tmp)[1] != Ylen )
+ if ( PyArray_DIMS( tmp )[0] != Xlen || PyArray_DIMS( tmp )[1] != Ylen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must match matrix." );
return NULL;
@@ -556,7 +557,7 @@
size = sizeof ( PLFLT ) * Ylen;
$1 = (PLFLT **) malloc( sizeof ( PLFLT* ) * Xlen );
for ( i = 0; i < Xlen; i++ )
- $1[i] = (PLFLT *) ( PyArray_DATA(tmp) + i * size );
+ $1[i] = (PLFLT *) ( PyArray_DATA( tmp ) + i * size );
}
%typemap( freearg ) const PLFLT * *MatrixCk {
Py_DECREF( tmp$argnum );
@@ -571,7 +572,7 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 2, 2 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Xlen || PyArray_DIMS(tmp)[1] != Ylen )
+ if ( PyArray_DIMS( tmp )[0] != Xlen || PyArray_DIMS( tmp )[1] != Ylen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must match matrix." );
return NULL;
@@ -579,7 +580,7 @@
size = sizeof ( PLFLT ) * Ylen;
$1 = (PLFLT **) malloc( sizeof ( PLFLT* ) * Xlen );
for ( i = 0; i < Xlen; i++ )
- $1[i] = (PLFLT *) ( PyArray_DATA(tmp) + i * size );
+ $1[i] = (PLFLT *) ( PyArray_DATA( tmp ) + i * size );
}
%typemap( freearg ) PLFLT * *OutMatrixCk {
Py_DECREF( tmp$argnum );
@@ -596,9 +597,9 @@
tmp = (PyArrayObject *) myArray_ContiguousFromObject( $input, NPY_PLFLT, 1, 1 );
if ( tmp == NULL )
return NULL;
- Ylen = PyArray_DIMS(tmp)[0];
+ Ylen = PyArray_DIMS( tmp )[0];
$2 = Ylen;
- $1 = (PLFLT *) PyArray_DATA(tmp);
+ $1 = (PLFLT *) PyArray_DATA( tmp );
// Make created 2D array have dimensions from prior ArrayX in the argument
// list and this ArrayY.
dims[0] = Xlen;
@@ -631,7 +632,7 @@
tmp = (PyArrayObject *) PyArray_ContiguousFromObject( $input, NPY_STRING, 1, 1 );
if ( tmp == NULL )
return NULL;
- if ( PyArray_DIMS(tmp)[0] != Alen )
+ if ( PyArray_DIMS( tmp )[0] != Alen )
{
PyErr_SetString( PyExc_ValueError, "Vectors must be same length." );
return NULL;
@@ -639,7 +640,7 @@
$1 = (char **) malloc( sizeof ( char* ) * Alen );
for ( i = 0; i < Alen; i++ )
{
- $1[i] = PyArray_DATA(tmp) + i * PyArray_STRIDES(tmp)[0];
+ $1[i] = PyArray_DATA( tmp ) + i * PyArray_STRIDES( tmp )[0];
if ( $1[i] == NULL )
{
free( $1 );
@@ -650,18 +651,18 @@
%typemap( freearg ) const char **ArrayCk { Py_DECREF( tmp$argnum ); free( $1 );}
// With count. Always allow NULL strings.
-%typemap( in ) (PLINT n, const char **Array) ( PyArrayObject * tmp )
+%typemap( in ) ( PLINT n, const char **Array ) ( PyArrayObject * tmp )
{
int i;
tmp = (PyArrayObject *) PyArray_ContiguousFromObject( $input, NPY_STRING, 1, 1 );
if ( tmp == NULL )
return NULL;
- Alen = PyArray_DIMS(tmp)[0];
+ Alen = PyArray_DIMS( tmp )[0];
$1 = Alen;
- $2 = (char **) malloc( sizeof ( char* ) * Alen );
+ $2 = (char **) malloc( sizeof ( char* ) * Alen );
for ( i = 0; i < Alen; i++ )
{
- $2[i] = PyArray_DATA(tmp) + i * PyArray_STRIDES(tmp)[0];
+ $2[i] = PyArray_DATA( tmp ) + i * PyArray_STRIDES( tmp )[0];
if ( $2[i] == NULL )
{
free( $2 );
@@ -669,7 +670,10 @@
}
}
}
-%typemap( freearg ) (PLINT n, const char **Array) { Py_DECREF( tmp$argnum ); free( $2 );}
+%typemap( freearg ) ( PLINT n, const char **Array )
+{
+ Py_DECREF( tmp$argnum ); free( $2 );
+}
//**************************
// String returning functions
@@ -732,8 +736,8 @@
PyErr_SetString( PyExc_ValueError, "Expected a sequence to two 1D arrays." );
return NULL;
}
- tmpGrid1.nx = PyArray_DIMS(pltr_xg)[0];
- tmpGrid1.ny = PyArray_DIMS(pltr_yg)[0];
+ tmpGrid1.nx = PyArray_DIMS( pltr_xg )[0];
+ tmpGrid1.ny = PyArray_DIMS( pltr_yg )[0];
if ( isimg == 0 )
{
if ( Xlen != tmpGrid1.nx || Ylen != tmpGrid1.ny )
@@ -750,8 +754,8 @@
return NULL;
}
}
- tmpGrid1.xg = (PLFLT *) PyArray_DATA(pltr_xg);
- tmpGrid1.yg = (PLFLT *) PyArray_DATA(pltr_yg);
+ tmpGrid1.xg = (PLFLT *) PyArray_DATA( pltr_xg );
+ tmpGrid1.yg = (PLFLT *) PyArray_DATA( pltr_yg );
return &tmpGrid1;
}
@@ -780,14 +784,14 @@
PyErr_SetString( PyExc_ValueError, "Expected a sequence of two 2D arrays." );
return NULL;
}
- if ( PyArray_DIMS(pltr_xg)[0] != PyArray_DIMS(pltr_yg)[0] ||
- PyArray_DIMS(pltr_xg)[1] != PyArray_DIMS(pltr_yg)[1] )
+ if ( PyArray_DIMS( pltr_xg )[0] != PyArray_DIMS( pltr_yg )[0] ||
+ PyArray_DIMS( pltr_xg )[1] != PyArray_DIMS( pltr_yg )[1] )
{
PyErr_SetString( PyExc_ValueError, "Arrays must be same size." );
return NULL;
}
- tmpGrid2.nx = PyArray_DIMS(pltr_xg)[0];
- tmpGrid2.ny = PyArray_DIMS(pltr_xg)[1];
+ tmpGrid2.nx = PyArray_DIMS( pltr_xg )[0];
+ tmpGrid2.ny = PyArray_DIMS( pltr_xg )[1];
if ( isimg == 0 )
{
if ( Xlen != tmpGrid2.nx || Ylen != tmpGrid2.ny )
@@ -807,10 +811,10 @@
size = sizeof ( PLFLT ) * tmpGrid2.ny;
tmpGrid2.xg = (PLFLT **) malloc( sizeof ( PLFLT* ) * tmpGrid2.nx );
for ( i = 0; i < tmpGrid2.nx; i++ )
- tmpGrid2.xg[i] = (PLFLT *) ( PyArray_DATA(pltr_xg) + i * size );
+ tmpGrid2.xg[i] = (PLFLT *) ( PyArray_DATA( pltr_xg ) + i * size );
tmpGrid2.yg = (PLFLT **) malloc( sizeof ( PLFLT* ) * tmpGrid2.nx );
for ( i = 0; i < tmpGrid2.nx; i++ )
- tmpGrid2.yg[i] = (PLFLT *) ( PyArray_DATA(pltr_yg) + i * size );
+ tmpGrid2.yg[i] = (PLFLT *) ( PyArray_DATA( pltr_yg ) + i * size );
return &tmpGrid2;
}
@@ -960,7 +964,7 @@
else
{
tmp = (PyArrayObject *) myArray_ContiguousFromObject( result, NPY_PLFLT, 1, 1 );
- if ( tmp == 0 || PyArray_DIMS(tmp)[0] != 2 )
+ if ( tmp == 0 || PyArray_DIMS( tmp )[0] != 2 )
{
fprintf( stderr, "pltr callback must return a 2 element array or sequence\n" );
PyErr_SetString( PyExc_RuntimeError, "pltr callback must return a 2-sequence." );
@@ -968,7 +972,7 @@
}
else
{
- PLFLT* t = (PLFLT *) PyArray_DATA(tmp);
+ PLFLT* t = (PLFLT *) PyArray_DATA( tmp );
*tx = t[0];
*ty = t[1];
Py_XDECREF( tmp );
@@ -1086,8 +1090,8 @@
// grab the Global Interpreter Lock to be sure threads don't mess us up
MY_BLOCK_THREADS
// build the argument list
- px = PyArray_SimpleNewFromData( 1, &n, NPY_PLFLT, (void *) xt );
- py = PyArray_SimpleNewFromData( 1, &n, NPY_PLFLT, (void *) yt );
+ px = PyArray_SimpleNewFromData( 1, &n, NPY_PLFLT, (void *) xt );
+ py = PyArray_SimpleNewFromData( 1, &n, NPY_PLFLT, (void *) yt );
arglist = Py_BuildValue( "(ddOOO)", x, y, px, py, pdata );
// call the python function
result = PyEval_CallObject( python_ct, arglist );
Modified: trunk/bindings/swig-support/plplotcapi.i
===================================================================
--- trunk/bindings/swig-support/plplotcapi.i 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/bindings/swig-support/plplotcapi.i 2013-06-06 21:44:33 UTC (rev 12372)
@@ -107,14 +107,14 @@
// 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_BOUNDING_BOX 64
-#define PL_LEGEND_ROW_MAJOR 128
+#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
// Flags for plcolorbar
#define PL_COLORBAR_LABEL_LEFT 0x1
@@ -481,7 +481,7 @@
const PLINT *ArrayCkNull, const PLFLT *ArrayCkNull,
const PLINT *ArrayCkNull, const char **ArrayCk );
-#if defined (SWIG_PYTHON) || defined(SWIG_JAVA) || defined(SWIG_OCTAVE)
+#if defined ( SWIG_PYTHON ) || defined ( SWIG_JAVA ) || defined ( SWIG_OCTAVE )
void
plcolorbar( PLFLT *OUTPUT, PLFLT *OUTPUT,
PLINT opt, PLINT position, PLFLT x, PLFLT y,
@@ -492,7 +492,7 @@
PLINT n, const PLINT *Array, const char **ArrayCk,
PLINT n, const char **Array,
const PLFLT *ArrayCk, const PLINT *ArrayCk,
- const PLINT *ArrayN , const PLFLT **MatrixCk );
+ const PLINT *ArrayN, const PLFLT **MatrixCk );
#endif
void
Modified: trunk/examples/c++/x15.cc
===================================================================
--- trunk/examples/c++/x15.cc 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/examples/c++/x15.cc 2013-06-06 21:44:33 UTC (rev 12372)
@@ -105,7 +105,7 @@
void x15::plot1( PLFLT **z, PLFLT zmin, PLFLT zmax )
{
PLFLT shade_min, shade_max, sh_color;
- int sh_cmap = 0;
+ int sh_cmap = 0;
PLFLT sh_width;
int min_color = 0, max_color = 0;
PLFLT min_width = 0.0, max_width = 0.0;
@@ -145,7 +145,7 @@
void x15::plot2( PLFLT **z, PLFLT zmin, PLFLT zmax )
{
PLFLT shade_min, shade_max, sh_color;
- int sh_cmap = 0;
+ int sh_cmap = 0;
PLFLT sh_width;
int min_color = 0, max_color = 0;
PLFLT min_width = 0.0, max_width = 0.0;
Modified: trunk/examples/c++/x16.cc
===================================================================
--- trunk/examples/c++/x16.cc 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/examples/c++/x16.cc 2013-06-06 21:44:33 UTC (rev 12372)
@@ -139,21 +139,21 @@
x16::x16( int argc, const char ** argv )
{
- int i, j;
- PLFLT x, y, argx, argy, distort, r, t, zmin, zmax;
- PLFLT *px = new PLFLT[PERIMETERPTS];
- PLFLT *py = new PLFLT[PERIMETERPTS];
- PLFLT *xg1 = new PLFLT[nx];
- PLFLT *yg1 = new PLFLT[ny];
- PLFLT **z;
- PLFLT **w;
- PLcGrid cgrid1;
- PLcGrid2 cgrid2;
- PLFLT *clevel = new PLFLT[ns];
- PLFLT *shedge = new PLFLT[ns + 1];
+ int i, j;
+ PLFLT x, y, argx, argy, distort, r, t, zmin, zmax;
+ PLFLT *px = new PLFLT[PERIMETERPTS];
+ PLFLT *py = new PLFLT[PERIMETERPTS];
+ PLFLT *xg1 = new PLFLT[nx];
+ PLFLT *yg1 = new PLFLT[ny];
+ PLFLT **z;
+ PLFLT **w;
+ PLcGrid cgrid1;
+ PLcGrid2 cgrid2;
+ PLFLT *clevel = new PLFLT[ns];
+ PLFLT *shedge = new PLFLT[ns + 1];
const int cont_color = 0;
const PLFLT fill_width = 2.0, cont_width = 0.0;
- PLFLT colorbar_width, colorbar_height;
+ PLFLT colorbar_width, colorbar_height;
#define NUM_AXES 1
PLINT n_axis_opts = NUM_AXES;
Modified: trunk/examples/c++/x33.cc
===================================================================
--- trunk/examples/c++/x33.cc 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/examples/c++/x33.cc 2013-06-06 21:44:33 UTC (rev 12372)
@@ -37,10 +37,10 @@
using namespace std;
#endif
-#define COLORBAR_KINDS 4
+#define COLORBAR_KINDS 4
#define COLORBAR_POSITIONS 4
-#define COLORBAR_LABELS 4
-#define COLORBAR_CAPS 4
+#define COLORBAR_LABELS 4
+#define COLORBAR_CAPS 4
class x33 {
public:
@@ -53,13 +53,13 @@
static const PLINT position_options[16];
static const char *special_symbols[5];
static const PLINT colorbar_option_kinds[COLORBAR_KINDS];
- static const char *colorbar_option_kind_labels[COLORBAR_KINDS];
+ static const char *colorbar_option_kind_labels[COLORBAR_KINDS];
static const PLINT colorbar_position_options[COLORBAR_POSITIONS];
- static const char *colorbar_position_option_labels[COLORBAR_POSITIONS];
+ static const char *colorbar_position_option_labels[COLORBAR_POSITIONS];
static const PLINT colorbar_label_options[COLORBAR_LABELS];
- static const char *colorbar_label_option_labels[COLORBAR_LABELS];
+ static const char *colorbar_label_option_labels[COLORBAR_LABELS];
static const PLINT colorbar_cap_options[COLORBAR_CAPS];
- static const char *colorbar_cap_option_labels[COLORBAR_CAPS];
+ static const char *colorbar_cap_option_labels[COLORBAR_CAPS];
void plcolorbar_example_page( int, int, int, PLINT, PLFLT, PLINT, PLFLT * );
void plcolorbar_example( const char *, int, PLINT, PLFLT, PLINT, PLFLT * );
@@ -105,7 +105,7 @@
PL_COLORBAR_IMAGE,
PL_COLORBAR_GRADIENT
};
-const char *x33::colorbar_option_kind_labels[COLORBAR_KINDS] = {
+const char *x33::colorbar_option_kind_labels[COLORBAR_KINDS] = {
"Shade colorbars",
"Shade colorbars with custom labels",
"Image colorbars",
@@ -119,7 +119,7 @@
PL_POSITION_TOP,
PL_POSITION_BOTTOM
};
-const char *x33::colorbar_position_option_labels[COLORBAR_POSITIONS] = {
+const char *x33::colorbar_position_option_labels[COLORBAR_POSITIONS] = {
"Left",
"Right",
"Top",
@@ -133,7 +133,7 @@
PL_COLORBAR_LABEL_TOP,
PL_COLORBAR_LABEL_BOTTOM
};
-const char *x33::colorbar_label_option_labels[COLORBAR_LABELS] = {
+const char *x33::colorbar_label_option_labels[COLORBAR_LABELS] = {
"Label left",
"Label right",
"Label top",
@@ -147,7 +147,7 @@
PL_COLORBAR_CAP_HIGH,
PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH
};
-const char *x33::colorbar_cap_option_labels[COLORBAR_CAPS] = {
+const char *x33::colorbar_cap_option_labels[COLORBAR_CAPS] = {
"No caps",
"Low cap",
"High cap",
@@ -859,7 +859,7 @@
// Free space that contained legend text.
for ( k = 0; k < MAX_NLEGEND; k++ )
delete [] text[k];
-
+
// Color bar examples
PLFLT values_small[2] = { -1.0e-200, 1.0e-200 };
PLFLT values_uneven[9] = { -1.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 };
@@ -873,18 +873,18 @@
// We can only test image and gradient colorbars with two element arrays
for ( i = 2; i < COLORBAR_KINDS; i++ )
- {
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small );
- }
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small );
+ }
// Test shade colorbars with larger arrays
for ( i = 0; i < 2; i++ )
- {
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even );
- }
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even );
+ }
for ( i = 0; i < 2; i++ )
- {
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven );
- }
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven );
+ }
//plend();
delete pls;
Modified: trunk/examples/java/x16.java
===================================================================
--- trunk/examples/java/x16.java 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/examples/java/x16.java 2013-06-06 21:44:33 UTC (rev 12372)
@@ -92,21 +92,21 @@
double[] shedge = new double[NSHADES + 1];
final int cont_color = 0;
final double fill_width = 2., cont_width = 0.;
- double[] colorbar_width = new double[1];
- double[] colorbar_height = new double[1];
+ double[] colorbar_width = new double[1];
+ double[] colorbar_height = new double[1];
- int n_axis_opts = NUM_AXES;
- int[] num_values = new int[NUM_AXES];
- double[][] values = new double[NUM_AXES][NSHADES+1];
- String axis_opts[] = { "bcvtm" };
- double axis_ticks[] = { 0.0 };
- int axis_subticks[] = { 0 };
- double filler_values[] = { 0.0, 1.0 };
-
- int n_labels = NUM_LABELS;
- int label_opts[] = { PL_COLORBAR_LABEL_BOTTOM };
- String labels[] = { "Magnitude" };
+ int n_axis_opts = NUM_AXES;
+ int[] num_values = new int[NUM_AXES];
+ double[][] values = new double[NUM_AXES][NSHADES + 1];
+ String axis_opts[] = { "bcvtm" };
+ double axis_ticks[] = { 0.0 };
+ int axis_subticks[] = { 0 };
+ double filler_values[] = { 0.0, 1.0 };
+ int n_labels = NUM_LABELS;
+ int label_opts[] = { PL_COLORBAR_LABEL_BOTTOM };
+ String labels[] = { "Magnitude" };
+
// Parse and process command line arguments.
pls.parseopts( args, PL_PARSE_FULL | PL_PARSE_NOPROGRAM );
@@ -191,9 +191,10 @@
pls.smin( 0.0, 0.5 );
num_values[0] = NSHADES + 1;
- for ( i = 0; i < NSHADES + 1; i++ ) {
- values[0][i] = shedge[i];
- }
+ for ( i = 0; i < NSHADES + 1; i++ )
+ {
+ values[0][i] = shedge[i];
+ }
pls.colorbar( colorbar_width, colorbar_height,
PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
@@ -240,9 +241,10 @@
pls.smin( 0.0, 0.5 );
num_values[0] = NSHADES + 1;
- for ( i = 0; i < NSHADES + 1; i++ ) {
- values[0][i] = shedge[i];
- }
+ for ( i = 0; i < NSHADES + 1; i++ )
+ {
+ values[0][i] = shedge[i];
+ }
pls.colorbar( colorbar_width, colorbar_height,
PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
@@ -290,9 +292,10 @@
pls.smin( 0.0, 0.5 );
num_values[0] = NSHADES + 1;
- for ( i = 0; i < NSHADES + 1; i++ ) {
- values[0][i] = shedge[i];
- }
+ for ( i = 0; i < NSHADES + 1; i++ )
+ {
+ values[0][i] = shedge[i];
+ }
pls.colorbar( colorbar_width, colorbar_height,
PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
@@ -341,13 +344,14 @@
pls.smin( 0.0, 0.5 );
num_values[0] = NSHADES + 1;
- for ( i = 0; i < NSHADES + 1; i++ ) {
- values[0][i] = shedge[i];
- }
+ for ( i = 0; i < NSHADES + 1; i++ )
+ {
+ values[0][i] = shedge[i];
+ }
pls.colorbar( colorbar_width, colorbar_height,
PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
- 2, 3.0,
+ 2, 3.0,
label_opts, labels,
axis_opts,
axis_ticks, axis_subticks,
@@ -418,9 +422,10 @@
pls.smin( 0.0, 0.5 );
num_values[0] = NSHADES + 1;
- for ( i = 0; i < NSHADES + 1; i++ ) {
- values[0][i] = shedge[i];
- }
+ for ( i = 0; i < NSHADES + 1; i++ )
+ {
+ values[0][i] = shedge[i];
+ }
pls.colorbar( colorbar_width, colorbar_height,
PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
Modified: trunk/examples/java/x33.java
===================================================================
--- trunk/examples/java/x33.java 2013-06-06 21:32:48 UTC (rev 12371)
+++ trunk/examples/java/x33.java 2013-06-06 21:44:33 UTC (rev 12372)
@@ -58,205 +58,205 @@
// plcolorbar options
- static String[] colorbar_option_kind_labels = {
- "Shade colorbars",
- "Shade colorbars with custom labels",
- "Image colorbars",
- "Gradient colorbars"
+ static String[] colorbar_option_kind_labels = {
+ "Shade colorbars",
+ "Shade colorbars with custom labels",
+ "Image colorbars",
+ "Gradient colorbars"
};
- static String[] colorbar_position_option_labels = {
- "Left",
- "Right",
- "Top",
- "Bottom"
+ static String[] colorbar_position_option_labels = {
+ "Left",
+ "Right",
+ "Top",
+ "Bottom"
};
-
- static String[] colorbar_label_option_labels = {
- "Label left",
- "Label right",
- "Label top",
- "Label bottom"
+
+ static String[] colorbar_label_option_labels = {
+ "Label left",
+ "Label right",
+ "Label top",
+ "Label bottom"
};
- static String[] colorbar_cap_option_labels = {
- "No caps",
- "Low cap",
- "High cap",
- "Low and high caps"
+ static String[] colorbar_cap_option_labels = {
+ "No caps",
+ "Low cap",
+ "High cap",
+ "Low and high caps"
};
- final static int COLORBAR_KINDS = 4;
+ final static int COLORBAR_KINDS = 4;
final static int COLORBAR_POSITIONS = 4;
- final static int COLORBAR_LABELS = 4;
- final static int COLORBAR_CAPS = 4;
+ final static int COLORBAR_LABELS = 4;
+ final static int COLORBAR_CAPS = 4;
void plcolorbar_example_page( int kind_i, int label_i, int cap_i, int cont_color, double cont_width, double[] values )
{
- int i;
- // Parameters for the colorbars on this page
- int position_i, position, opt;
- double x, y, x_length, y_length;
- double[] ticks = { 0.0 };
- int[] sub_ticks = { 0 };
- double low_cap_color, high_cap_color;
- boolean vertical, ifn;
- int n_axes = 1;
- String[] axis_opts = new String[1];
- int n_labels = 1;
- int[] label_opts = { 0 };
- String[] label = new String[1];
- String title;
- double[] colorbar_width = new double[1];
- double[] colorbar_height = new double[1];
- int[] n_values_array = new int[1];
- double[][] values_array = new double[1][values.length];
+ int i;
+ // Parameters for the colorbars on this page
+ int position_i, position, opt;
+ double x, y, x_length, y_length;
+ double[] ticks = { 0.0 };
+ int[] sub_ticks = { 0 };
+ double low_cap_color, high_cap_color;
+ boolean vertical, ifn;
+ int n_axes = 1;
+ String[] axis_opts = new String[1];
+ int n_labels = 1;
+ int[] label_opts = { 0 };
+ String[] label = new String[1];
+ String title;
+ double[] colorbar_width = new double[1];
+ double[] colorbar_height = new double[1];
+ int[] n_values_array = new int[1];
+ double[][] values_array = new double[1][values.length];
- // Colorbar type options
- int[] colorbar_option_kinds = {
- PL_COLORBAR_SHADE,
- PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL,
- PL_COLORBAR_IMAGE,
- PL_COLORBAR_GRADIENT
- };
- // Which side of the page are we positioned relative to?
- int[] colorbar_position_options = {
- PL_POSITION_LEFT,
- PL_POSITION_RIGHT,
- PL_POSITION_TOP,
- PL_POSITION_BOTTOM
- };
- // Colorbar label positioning options
- int[] colorbar_label_options = {
- PL_COLORBAR_LABEL_LEFT,
- PL_COLORBAR_LABEL_RIGHT,
- PL_COLORBAR_LABEL_TOP,
- PL_COLORBAR_LABEL_BOTTOM
- };
- // Colorbar cap options
- int[] colorbar_cap_options = {
- PL_COLORBAR_CAP_NONE,
- PL_COLORBAR_CAP_LOW,
- PL_COLORBAR_CAP_HIGH,
- PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH
- };
+ // Colorbar type options
+ int[] colorbar_option_kinds = {
+ PL_COLORBAR_SHADE,
+ PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL,
+ PL_COLORBAR_IMAGE,
+ PL_COLORBAR_GRADIENT
+ };
+ // Which side of the page are we positioned relative to?
+ int[] colorbar_position_options = {
+ PL_POSITION_LEFT,
+ PL_POSITION_RIGHT,
+ PL_POSITION_TOP,
+ PL_POSITION_BOTTOM
+ };
+ // Colorbar label positioning options
+ int[] colorbar_label_options = {
+ PL_COLORBAR_LABEL_LEFT,
+ PL_COLORBAR_LABEL_RIGHT,
+ PL_COLORBAR_LABEL_TOP,
+ PL_COLORBAR_LABEL_BOTTOM
+ };
+ // Colorbar cap options
+ int[] colorbar_cap_options = {
+ PL_COLORBAR_CAP_NONE,
+ PL_COLORBAR_CAP_LOW,
+ PL_COLORBAR_CAP_HIGH,
+ PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH
+ };
- n_values_array[0] = values.length;
- for ( i = 0; i < n_values_array[0]; i++ )
- values_array[0][i] = values[i];
+ n_values_array[0] = values.length;
+ for ( i = 0; i < n_values_array[0]; i++ )
+ values_array[0][i] = values[i];
- low_cap_color = 0.0;
- high_cap_color = 1.0;
+ low_cap_color = 0.0;
+ high_cap_color = 1.0;
- // Start a new page
- pls.adv( 0 );
+ // Start a new page
+ pls.adv( 0 );
- // Draw one colorbar relative to each side of the page
- for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i++ )
- {
- position = colorbar_position_options[position_i];
- opt =
- colorbar_option_kinds[kind_i] |
- colorbar_label_options[label_i] |
- colorbar_cap_options[cap_i];
-
- vertical = ((position & PL_POSITION_LEFT) != 0) || ((position & PL_POSITION_RIGHT) != 0);
- ifn = ((position & PL_POSITION_LEFT) != 0) || ((position & PL_POSITION_BOTTOM) != 0);
+ // Draw one colorbar relative to each side of the page
+ for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i++ )
+ {
+ position = colorbar_position_options[position_i];
+ opt =
+ colorbar_option_kinds[kind_i] |
+ colorbar_label_options[label_i] |
+ colorbar_cap_options[cap_i];
- // Set the offset position on the page
- if ( vertical )
- {
- x = 0.0;
- y = 0.0;
- x_length = 0.05;
- y_length = 0.5;
- }
- else
- {
- x = 0.0;
- y = 0.0;
- x_length = 0.5;
- y_length = 0.05;
- }
+ vertical = ( ( position & PL_POSITION_LEFT ) != 0 ) || ( ( position & PL_POSITION_RIGHT ) != 0 );
+ ifn = ( ( position & PL_POSITION_LEFT ) != 0 ) || ( ( position & PL_POSITION_BOTTOM ) != 0 );
- // Set appropriate labelling options.
- if ( ifn )
+ // Set the offset position on the page
+ if ( vertical )
{
- if ( cont_color == 0 || cont_width == 0. )
+ x = 0.0;
+ y = 0.0;
+ x_length = 0.05;
+ y_length = 0.5;
+ }
+ else
+ {
+ x = 0.0;
+ y = 0.0;
+ x_length = 0.5;
+ y_length = 0.05;
+ }
+
+ // Set appropriate labelling options.
+ if ( ifn )
+ {
+ if ( cont_color == 0 || cont_width == 0. )
{
- axis_opts[0] = "uwtivn";
- }
- else
- {
- axis_opts[0] = "uwxvn";
- }
- }
- else
+ axis_opts[0] = "uwtivn";
+ }
+ else
+ {
+ axis_opts[0] = "uwxvn";
+ }
+ }
+ else
{
- if ( cont_color == 0 || cont_width == 0. )
- {
- axis_opts[0] = "uwtivm";
- }
- else
+ if ( cont_color == 0 || cont_width == 0. )
{
- axis_opts[0] = "uwxvm";
- }
- }
-
- label[0] = colorbar_position_option_labels[position_i] + ", " +
- colorbar_label_option_labels[label_i];
+ axis_opts[0] = "uwtivm";
+ }
+ else
+ {
+ axis_opts[0] = "uwxvm";
+ }
+ }
- // Smaller text
- pls.schr( 0.0, 0.75 );
- // Small ticks on the vertical axis
- pls.smaj( 0.0, 0.5 );
- pls.smin( 0.0, 0.5 );
+ label[0] = colorbar_position_option_labels[position_i] + ", " +
+ colorbar_label_option_labels[label_i];
- pls.vpor( 0.20, 0.80, 0.20, 0.80 );
- pls.wind( 0.0, 1.0, 0.0, 1.0 );
- // Set interesting background colour.
- pls.scol0a( 15, 0, 0, 0, 0.20 );
- pls.colorbar( colorbar_width, colorbar_height,
- opt | PL_COLORBAR_BOUNDING_BOX | PL_COLORBAR_BACKGROUND, position,
- x, y, x_length, y_length,
- 15, 1, 1,
- low_cap_color, high_cap_color,
- cont_color, cont_width,
- label_opts, label, axis_opts,
- ticks, sub_ticks,
- n_values_array, values_array );
+ // Smaller text
+ pls.schr( 0.0, 0.75 );
+ // Small ticks on the vertical axis
+ pls.smaj( 0.0, 0.5 );
+ pls.smin( 0.0, 0.5 );
- // Reset text and tick sizes
- pls.schr( 0.0, 1.0 );
- pls.smaj( 0.0, 1.0 );
- pls.smin( 0.0, 1.0 );
- }
+ pls.vpor( 0.20, 0.80, 0.20, 0.80 );
+ pls.wind( 0.0, 1.0, 0.0, 1.0 );
+ // Set interesting background colour.
+ pls.scol0a( 15, 0, 0, 0, 0.20 );
+ pls.colorbar( colorbar_width, colorbar_height,
+ opt | PL_COLORBAR_BOUNDING_BOX | PL_COLORBAR_BACKGROUND, position,
+ x, y, x_length, y_length,
+ 15, 1, 1,
+ low_cap_color, high_cap_color,
+ cont_color, cont_width,
+ label_opts, label, axis_opts,
+ ticks, sub_ticks,
+ n_values_array, values_array );
- // Draw a page title
- title = colorbar_option_kind_labels[kind_i] + " - " +
- colorbar_cap_option_labels[cap_i];
- pls.vpor( 0.0, 1.0, 0.0, 1.0 );
- pls.wind( 0.0, 1.0, 0.0, 1.0 );
- pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title );
+ // Reset text and tick sizes
+ pls.schr( 0.0, 1.0 );
+ pls.smaj( 0.0, 1.0 );
+ pls.smin( 0.0, 1.0 );
+ }
+
+ // Draw a page title
+ title = colorbar_option_kind_labels[kind_i] + " - " +
+ colorbar_cap_option_labels[cap_i];
+ pls.vpor( 0.0, 1.0, 0.0, 1.0 );
+ pls.wind( 0.0, 1.0, 0.0, 1.0 );
+ pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title );
}
void plcolorbar_example( String palette, int kind_i, int cont_color, double cont_width, double[] values )
{
- int label_i, cap_i;
-
- // Load the color palette
- pls.spal1( palette, true );
-
- for ( label_i = 0; label_i < COLORBAR_LABELS; label_i++ )
- {
- for ( cap_i = 0; cap_i < COLORBAR_CAPS; cap_i++ )
+ int label_i, cap_i;
+
+ // Load the color palette
+ pls.spal1( palette, true );
+
+ for ( label_i = 0; label_i < COLORBAR_LABELS; label_i++ )
+ {
+ for ( cap_i = 0; cap_i < COLORBAR_CAPS; cap_i++ )
{
- plcolorbar_example_page( kind_i, label_i, cap_i,
- cont_color, cont_width,
- values );
- }
- }
+ plcolorbar_example_page( kind_i, label_i, cap_i,
+ cont_color, cont_width,
+ values );
+ }
+ }
}
@@ -888,31 +888,31 @@
null, null, null, null );
max_height = Math.max( max_height, legend_height[0] );
- // Color bar examples
- double[] values_small = { -1.0e-200, 1.0e-200 };
- double[] values_uneven = { -1.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 };
- double[] values_even = { -2.0e-200, -1.0e-200, 0.0e-200, 1.0e-200, 2.0e-200, 3.0e-200, 4.0e-200, 5.0e-200, 6.0e-200 };
+ // Color bar examples
+ double[] values_small = { -1.0e-200, 1.0e-200 };
+ double[] values_uneven = { -1.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 };
+ double[] values_even = { -2.0e-200, -1.0e-200, 0.0e-200, 1.0e-200, 2.0e-200, 3.0e-200, 4.0e-200, 5.0e-200, 6.0e-200 };
- // Use unsaturated green background colour to contrast with black caps.
- pls.scolbg( 70, 185, 70 );
- // Cut out the greatest and smallest bits of the color spectrum to
- // leave colors for the end caps.
- pls.scmap1_range( 0.01, 0.99 );
+ // Use unsaturated green background colour to contrast with black caps.
+ pls.scolbg( 70, 185, 70 );
+ // Cut out the greatest and smallest bits of the color spectrum to
+ // leave colors for the end caps.
+ pls.scmap1_range( 0.01, 0.99 );
- // We can only test image and gradient colorbars with two element arrays
- for ( i = 2; i < COLORBAR_KINDS; i++ )
- {
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, values_small );
- }
- // Test shade colorbars with larger arrays
- for ( i = 0; i < 2; i++ )
+ // We can only test image and gradient colorbars with two element arrays
+ for ( i = 2; i < COLORBAR_KINDS; i++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, values_even );
- }
- for ( i = 0; i < 2; i++ )
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, values_small );
+ }
+ // Test shade colorbars with larger arrays
+ for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, values_uneven );
- }
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, values_even );
+ }
+ for ( i = 0; i < 2; i++ )
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, values_uneven );
+ }
pls.end();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|