00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "plstubs.h"
00026
00027 void
00028 PLOT3DC__( PLFLT *x, PLFLT *y, PLFLT *z,
00029 PLINT *nx, PLINT *ny, PLINT *opt,
00030 PLFLT *clevel, PLINT *nlevel, PLINT *lx )
00031 {
00032 PLFLT ** a;
00033 int i, j;
00034
00035
00036 plAlloc2dGrid( &a, *nx, *ny );
00037 for ( i = 0; i < *nx; i++ )
00038 {
00039 for ( j = 0; j < *ny; j++ )
00040 {
00041 a[i][j] = z[i + j * *lx];
00042 }
00043 }
00044
00045 c_plot3dc( x, y, (const PLFLT **) a, *nx, *ny, *opt, clevel, *nlevel );
00046
00047
00048 plFree2dGrid( a, *nx, *ny );
00049 }
00050
00051 void
00052 PLOT3DC( PLFLT *x, PLFLT *y, PLFLT *z,
00053 PLINT *nx, PLINT *ny, PLINT *opt,
00054 PLFLT *clevel, PLINT *nlevel, PLINT *lx )
00055 {
00056 PLOT3DC__( x, y, z, nx, ny, opt, clevel, nlevel, lx );
00057 }
00058
00059 void
00060 PLSURF3D( PLFLT *x, PLFLT *y, PLFLT *z,
00061 PLINT *nx, PLINT *ny, PLINT *opt,
00062 PLFLT *clevel, PLINT *nlevel, PLINT *lx )
00063 {
00064 int i, j;
00065 PLFLT **temp;
00066
00067
00068
00069
00070
00071
00072 if ( !( temp = (PLFLT **) malloc( (size_t) *nx * sizeof ( PLFLT * ) ) ) )
00073 {
00074 plabort( "PLSURF3D: Out of memory" );
00075 return;
00076 }
00077
00078 for ( i = 0; i < *nx; i++ )
00079 {
00080 if ( !( temp[i] = (PLFLT *) malloc( (size_t) *ny * sizeof ( PLFLT ) ) ) )
00081 {
00082 int ii;
00083
00084 for ( ii = 0; ii < i - 1; ii++ )
00085 free( (void *) temp[i] );
00086 free( (void *) temp );
00087 plabort( "PLSURF3D: Out of memory" );
00088 return;
00089 }
00090 }
00091
00092 for ( i = 0; i < *nx; i++ )
00093 for ( j = 0; j < *ny; j++ )
00094 temp[i][j] = *( z + j * *lx + i );
00095
00096 c_plsurf3d( x, y, (const PLFLT **) temp, *nx, *ny, *opt, clevel, *nlevel );
00097
00098 for ( i = 0; i < *nx; i++ )
00099 free( (void *) temp[i] );
00100
00101 free( (void *) temp );
00102 }
00103
00104 void
00105 PLMESH( PLFLT *x, PLFLT *y, PLFLT *z,
00106 PLINT *nx, PLINT *ny, PLINT *opt, PLINT *lx )
00107 {
00108 PLINT optlocal, nlevel = 0;
00109 PLFLT clevel = 0.;
00110
00111 optlocal = *opt | MESH;
00112 PLOT3DC__( x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx );
00113 }
00114
00115 void
00116 PLMESHC( PLFLT *x, PLFLT *y, PLFLT *z,
00117 PLINT *nx, PLINT *ny, PLINT *opt,
00118 PLFLT *clevel, PLINT *nlevel, PLINT *lx )
00119 {
00120 PLINT optlocal;
00121 optlocal = *opt | MESH;
00122 PLOT3DC__( x, y, z, nx, ny, &optlocal, clevel, nlevel, lx );
00123 }
00124
00125
00126 void
00127 PLOT3D( PLFLT *x, PLFLT *y, PLFLT *z,
00128 PLINT *nx, PLINT *ny, PLINT *opt, PLBOOL *side, PLINT *lx )
00129 {
00130 PLINT optlocal, nlevel = 0;
00131 PLFLT clevel = 0.;
00132
00133 optlocal = *opt | ( *side != 0 ? DRAW_SIDES : 0 );
00134 PLOT3DC__( x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx );
00135 }
00136