• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

sccont.c

Go to the documentation of this file.
00001 // $Id: sccont.c 11759 2011-06-01 17:41:34Z airwin $
00002 //
00003 //      Contour plotter front-ends for Fortran.
00004 //
00005 // Copyright (C) 2004  Alan W. Irwin
00006 //
00007 // This file is part of PLplot.
00008 //
00009 // PLplot is free software; you can redistribute it and/or modify
00010 // it under the terms of the GNU Library General Public License as published
00011 // by the Free Software Foundation; either version 2 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // PLplot is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU Library General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU Library General Public License
00020 // along with PLplot; if not, write to the Free Software
00021 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00022 //
00023 //
00024 
00025 #include "plstubs.h"
00026 
00027 //--------------------------------------------------------------------------
00028 // pltr0f()
00029 //
00030 // Identity transformation for plots from Fortran.
00031 // Only difference from C-language identity function (pltr0) is that the
00032 // Fortran paradigm for array index is used, i.e. starting at 1.
00033 //--------------------------------------------------------------------------
00034 
00035 void
00036 pltr0f( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data )
00037 {
00038     *tx = x + 1.0;
00039     *ty = y + 1.0;
00040 }
00041 
00042 //--------------------------------------------------------------------------
00043 // Contour plotter front-ends.
00044 // These specify the row-dominant function evaluator in the plfcont
00045 // argument list.  NO TRANSPOSE IS NECESSARY.  The routines are as follows:
00046 //
00047 // - plcon0     no transformation
00048 // - plcon1     linear interpolation from singly dimensioned coord arrays
00049 // - plcon2     linear interpolation from doubly dimensioned coord arrays
00050 //
00051 // The latter two work by calling plfcont() with the appropriate grid
00052 // structure for input to pltr2f().
00053 //--------------------------------------------------------------------------
00054 
00055 // no transformation
00056 
00057 void
00058 PLCON07( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx,
00059          PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel )
00060 {
00061     PLfGrid fgrid;
00062 
00063     fgrid.nx = *nx;
00064     fgrid.ny = *ny;
00065     fgrid.f  = z;
00066 
00067     plfcont( plf2evalr, (void *) &fgrid,
00068         *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel,
00069         pltr0f, NULL );
00070 }
00071 
00072 // 1-d transformation
00073 
00074 void
00075 PLCON17( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx,
00076          PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel,
00077          PLFLT *xg, PLFLT *yg )
00078 {
00079     PLfGrid fgrid;
00080     PLcGrid cgrid;
00081 
00082     fgrid.nx = *nx;
00083     fgrid.ny = *ny;
00084     fgrid.f  = z;
00085 
00086     cgrid.nx = *nx;
00087     cgrid.ny = *ny;
00088     cgrid.xg = xg;
00089     cgrid.yg = yg;
00090 
00091     plfcont( plf2evalr, (void *) &fgrid,
00092         *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel,
00093         pltr1, (void *) &cgrid );
00094 }
00095 
00096 // 2-d transformation
00097 
00098 void
00099 PLCON27( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx,
00100          PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel,
00101          PLFLT *xg, PLFLT *yg )
00102 {
00103     PLfGrid fgrid;
00104     PLcGrid cgrid;
00105 
00106     fgrid.nx = *nx;
00107     fgrid.ny = *ny;
00108     fgrid.f  = z;
00109 
00110     cgrid.nx = *nx;
00111     cgrid.ny = *ny;
00112     cgrid.xg = xg;
00113     cgrid.yg = yg;
00114 
00115     plfcont( plf2evalr, (void *) &fgrid,
00116         *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel,
00117         pltr2f, (void *) &cgrid );
00118 }
00119 
00120 //--------------------------------------------------------------------------
00121 // Vector plotter front-ends.
00122 // These specify the row-dominant function evaluator in the plfvect
00123 // argument list.  NO TRANSPOSE IS NECESSARY.  The routines are as follows:
00124 //
00125 // - plvec0     no transformation
00126 // - plvec1     linear interpolation from singly dimensioned coord arrays
00127 // - plvec2     linear interpolation from doubly dimensioned coord arrays
00128 //
00129 // The latter two work by calling plfvect() with the appropriate grid
00130 // structure for input to pltr2f().
00131 //--------------------------------------------------------------------------
00132 
00133 // no transformation
00134 
00135 void
00136 PLVEC07( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale )
00137 {
00138     PLfGrid fgrid1, fgrid2;
00139 
00140     fgrid1.nx = *nx;
00141     fgrid1.ny = *ny;
00142     fgrid1.f  = u;
00143 
00144     fgrid2.nx = *nx;
00145     fgrid2.ny = *ny;
00146     fgrid2.f  = v;
00147 
00148     plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2,
00149         *nx, *ny, *scale, pltr0f, NULL );
00150 }
00151 
00152 // 1-d transformation
00153 
00154 void
00155 PLVEC17( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale,
00156          PLFLT *xg, PLFLT *yg )
00157 {
00158     PLfGrid fgrid1;
00159     PLfGrid fgrid2;
00160     PLcGrid cgrid;
00161 
00162     fgrid1.nx = *nx;
00163     fgrid1.ny = *ny;
00164     fgrid1.f  = u;
00165 
00166     fgrid2.nx = *nx;
00167     fgrid2.ny = *ny;
00168     fgrid2.f  = v;
00169 
00170     cgrid.nx = *nx;
00171     cgrid.ny = *ny;
00172     cgrid.xg = xg;
00173     cgrid.yg = yg;
00174 
00175     plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2,
00176         *nx, *ny, *scale, pltr1, (void *) &cgrid );
00177 }
00178 
00179 // 2-d transformation
00180 
00181 void
00182 PLVEC27( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale,
00183          PLFLT *xg, PLFLT *yg )
00184 {
00185     PLfGrid fgrid1;
00186     PLfGrid fgrid2;
00187     PLcGrid cgrid;
00188 
00189     fgrid1.nx = *nx;
00190     fgrid1.ny = *ny;
00191     fgrid1.f  = u;
00192 
00193     fgrid2.nx = *nx;
00194     fgrid2.ny = *ny;
00195     fgrid2.f  = v;
00196 
00197     cgrid.nx = *nx;
00198     cgrid.ny = *ny;
00199     cgrid.xg = xg;
00200     cgrid.yg = yg;
00201 
00202     plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2,
00203         *nx, *ny, *scale, pltr2f, (void *) &cgrid );
00204 }
00205 
00206 //--------------------------------------------------------------------------
00207 // Here are the old contour plotters.
00208 //--------------------------------------------------------------------------
00209 
00210 static void
00211 pltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data )
00212 {
00213     PLFLT *tr = (PLFLT *) pltr_data;
00214 
00215     *tx = tr[0] * x + tr[1] * y + tr[2];
00216     *ty = tr[3] * x + tr[4] * y + tr[5];
00217 }
00218 
00219 void
00220 PLCONT7( PLFLT *z, PLINT *nx, PLINT *ny, PLINT *kx, PLINT *lx,
00221          PLINT *ky, PLINT *ly, PLFLT *clevel, PLINT *nlevel, PLFLT *ftr )
00222 {
00223     PLfGrid fgrid;
00224 
00225     fgrid.nx = *nx;
00226     fgrid.ny = *ny;
00227     fgrid.f  = z;
00228 
00229     plfcont( plf2evalr, (void *) &fgrid,
00230         *nx, *ny, *kx, *lx, *ky, *ly, clevel, *nlevel,
00231         pltr, (void *) ftr );
00232 }
00233 
00234 void
00235 PLVECT7( PLFLT *u, PLFLT *v, PLINT *nx, PLINT *ny, PLFLT *scale,
00236          PLFLT *ftr )
00237 {
00238     PLfGrid fgrid1;
00239     PLfGrid fgrid2;
00240 
00241     fgrid1.nx = *nx;
00242     fgrid1.ny = *ny;
00243     fgrid1.f  = u;
00244 
00245     fgrid2.nx = *nx;
00246     fgrid2.ny = *ny;
00247     fgrid2.f  = v;
00248 
00249     plfvect( plf2evalr, (void *) &fgrid1, (void *) &fgrid2,
00250         *nx, *ny, *scale,
00251         pltr, (void *) ftr );
00252 }
00253 
00254 //--------------------------------------------------------------------------
00255 // plfshade front-ends.
00256 // These specify the row-dominant function evaluator in the plfshade
00257 // argument list.  NO TRANSPOSE IS NECESSARY.  The routines are as follows:
00258 //
00259 // - plshade0   map indices to xmin, xmax, ymin, ymax.
00260 // The next two work by calling plfshade() with the appropriate grid
00261 // structure for input to pltr2f().
00262 // - plshade1   linear interpolation from singly dimensioned coord arrays
00263 // - plshade2   linear interpolation from doubly dimensioned coord arrays
00264 // - plshade    tr array transformation
00265 //
00266 //--------------------------------------------------------------------------
00267 
00268 void
00269 PLSHADE07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00270            PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00271            PLFLT *shade_min, PLFLT *shade_max,
00272            PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width,
00273            PLINT *min_color, PLINT *min_width,
00274            PLINT *max_color, PLINT *max_width, PLINT *lx )
00275 {
00276     PLINT   rect = 1;
00277 
00278     PLfGrid data;
00279 
00280 // Fill a grid data structure to hold the fortran z array.
00281     data.f  = z;
00282     data.nx = *lx;
00283     data.ny = *ny;
00284 
00285 
00286 // Call plfshade to do the actual work - plf2evalr is the
00287 //   interface that deals with the fortran data organisation
00288 
00289     plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny,
00290         *xmin, *xmax, *ymin, *ymax,
00291         *shade_min, *shade_max,
00292         *sh_cmap, *sh_color, *sh_width,
00293         *min_color, *min_width, *max_color, *max_width,
00294         c_plfill, rect, NULL, NULL );
00295 
00296 // Clean up memory allocated for a
00297 //
00298 //    plFree2dGrid( a, *nx, *ny );
00299 //
00300 }
00301 
00302 
00303 // 1-d transformation
00304 
00305 void
00306 PLSHADE17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00307            PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00308            PLFLT *shade_min, PLFLT *shade_max,
00309            PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width,
00310            PLINT *min_color, PLINT *min_width,
00311            PLINT *max_color, PLINT *max_width,
00312            PLFLT *xg1, PLFLT *yg1, PLINT *lx )
00313 {
00314     PLINT   rect = 1;
00315     PLfGrid data;
00316     PLcGrid cgrid;
00317 
00318 // Fill a grid data structure to hold the coordinate arrays.
00319 
00320     cgrid.nx = *nx;
00321     cgrid.ny = *ny;
00322     cgrid.xg = xg1;
00323     cgrid.yg = yg1;
00324 
00325 // Fill a grid data structure to hold the fortran z array.
00326     data.f  = z;
00327     data.nx = *lx;
00328     data.ny = *ny;
00329 
00330 // Call plfshade to do the actual work - plf2evalr is the
00331 //   interface that deals with the fortran data organisation.
00332 
00333     plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny,
00334         *xmin, *xmax, *ymin, *ymax,
00335         *shade_min, *shade_max,
00336         *sh_cmap, *sh_color, *sh_width,
00337         *min_color, *min_width, *max_color, *max_width,
00338         c_plfill, rect, pltr1, ( PLPointer ) & cgrid );
00339 }
00340 
00341 // 2-d transformation
00342 
00343 void
00344 PLSHADE27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00345            PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00346            PLFLT *shade_min, PLFLT *shade_max,
00347            PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width,
00348            PLINT *min_color, PLINT *min_width,
00349            PLINT *max_color, PLINT *max_width,
00350            PLFLT *xg2, PLFLT *yg2, PLINT *lx )
00351 {
00352     PLINT   rect = 0;
00353     PLfGrid data;
00354     PLcGrid cgrid;
00355 
00356 // Fill a grid data structure to hold the coordinate arrays.
00357     cgrid.nx = *lx;
00358     cgrid.ny = *ny;
00359     cgrid.xg = xg2;
00360     cgrid.yg = yg2;
00361 
00362 // Fill a grid data structure to hold the fortran z array.
00363     data.f  = z;
00364     data.nx = *lx;
00365     data.ny = *ny;
00366 
00367 // Call plfshade to do the actual work - plf2evalr is the
00368 //   interface that deals with the fortran data organisation.
00369 
00370     plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny,
00371         *xmin, *xmax, *ymin, *ymax,
00372         *shade_min, *shade_max,
00373         *sh_cmap, *sh_color, *sh_width,
00374         *min_color, *min_width, *max_color, *max_width,
00375         c_plfill, rect, pltr2f, ( PLPointer ) & cgrid );
00376 }
00377 
00378 void
00379 PLSHADE7( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00380           PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00381           PLFLT *shade_min, PLFLT *shade_max,
00382           PLINT *sh_cmap, PLFLT *sh_color, PLINT *sh_width,
00383           PLINT *min_color, PLINT *min_width,
00384           PLINT *max_color, PLINT *max_width, PLFLT *ftr, PLINT *lx )
00385 {
00386     PLINT   rect = 1;
00387     PLfGrid data;
00388 
00389 // Fill a grid data structure to hold the fortran z array.
00390     data.f  = z;
00391     data.nx = *lx;
00392     data.ny = *ny;
00393 
00394 // Call plfshade to do the actual work - plf2evalr is the
00395 //   interface that deals with the fortran data organisation.
00396 
00397     plfshade( plf2evalr, &data, NULL, NULL, *nx, *ny,
00398         *xmin, *xmax, *ymin, *ymax,
00399         *shade_min, *shade_max,
00400         *sh_cmap, *sh_color, *sh_width,
00401         *min_color, *min_width, *max_color, *max_width,
00402         c_plfill, rect, pltr, (PLPointer) ftr );
00403 }
00404 
00405 //--------------------------------------------------------------------------
00406 // plshades front-ends.
00407 //
00408 // - plshades0  map indices to xmin, xmax, ymin, ymax
00409 // - plshades1  linear interpolation from singly dimensioned coord arrays
00410 // - plshades2  linear interpolation from doubly dimensioned coord arrays
00411 // - plshades   pass tr information with plplot common block (and
00412 //              then pass tr as last argument of PLSHADES7)
00413 //--------------------------------------------------------------------------
00414 
00415 void
00416 PLSHADES07( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00417             PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00418             PLFLT *clevel, PLINT *nlevel, PLINT *fill_width,
00419             PLINT *cont_color, PLINT *cont_width, PLINT *lx )
00420 {
00421     PLINT    rect = 1;
00422     PLfGrid2 data;
00423 
00424 // Fill a grid data structure to hold the fortran z array.
00425     data.f  = (PLFLT **) z;
00426     data.nx = *lx;
00427     data.ny = *ny;
00428 
00429 // Call plfshades to do the actual work - plf2ops_col_major() returns a collection
00430 //   of functions to access the data in fortran style.
00431     plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL,
00432         *xmin, *xmax, *ymin, *ymax,
00433         clevel, *nlevel, *fill_width,
00434         *cont_color, *cont_width,
00435         c_plfill, rect, NULL, NULL );
00436 }
00437 
00438 void
00439 PLSHADES17( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00440             PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00441             PLFLT *clevel, PLINT *nlevel, PLINT *fill_width,
00442             PLINT *cont_color, PLINT *cont_width,
00443             PLFLT *xg1, PLFLT *yg1, PLINT *lx )
00444 {
00445     PLINT    rect = 1;
00446     PLfGrid2 data;
00447     PLcGrid  cgrid;
00448 
00449 // Fill a grid data structure to hold the fortran z array.
00450     data.f  = (PLFLT **) z;
00451     data.nx = *lx;
00452     data.ny = *ny;
00453 
00454 // Fill a grid data structure to hold the coordinate arrays.
00455     cgrid.nx = *nx;
00456     cgrid.ny = *ny;
00457     cgrid.xg = xg1;
00458     cgrid.yg = yg1;
00459 
00460 // Call plfshades to do the actual work - plf2ops_col_major() returns a collection
00461 //   of functions to access the data in fortran style.
00462     plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL,
00463         *xmin, *xmax, *ymin, *ymax,
00464         clevel, *nlevel, *fill_width,
00465         *cont_color, *cont_width,
00466         c_plfill, rect, pltr1, ( PLPointer ) & cgrid );
00467 }
00468 
00469 void
00470 PLSHADES27( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00471             PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00472             PLFLT *clevel, PLINT *nlevel, PLINT *fill_width,
00473             PLINT *cont_color, PLINT *cont_width,
00474             PLFLT *xg2, PLFLT *yg2, PLINT *lx )
00475 {
00476     PLINT    rect = 0;
00477     PLfGrid2 data;
00478     PLcGrid  cgrid;
00479 
00480 // Fill a grid data structure to hold the fortran z array.
00481     data.f  = (PLFLT **) z;
00482     data.nx = *lx;
00483     data.ny = *ny;
00484 
00485 // Fill a grid data structure to hold the coordinate arrays.
00486     cgrid.nx = *lx;
00487     cgrid.ny = *ny;
00488     cgrid.xg = xg2;
00489     cgrid.yg = yg2;
00490 
00491 // Call plfshades to do the actual work - plf2ops_col_major() returns a collection
00492 //   of functions to access the data in fortran style.
00493     plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL,
00494         *xmin, *xmax, *ymin, *ymax,
00495         clevel, *nlevel, *fill_width,
00496         *cont_color, *cont_width,
00497         c_plfill, rect, pltr2f, ( PLPointer ) & cgrid );
00498 }
00499 
00500 void
00501 PLSHADES7( PLFLT *z, PLINT *nx, PLINT *ny, const char *defined,
00502            PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00503            PLFLT *clevel, PLINT *nlevel, PLINT *fill_width,
00504            PLINT *cont_color, PLINT *cont_width, PLFLT *ftr, PLINT *lx )
00505 {
00506     PLINT    rect = 1;
00507     PLfGrid2 data;
00508 
00509 // Fill a grid data structure to hold the fortran z array.
00510     data.f  = (PLFLT **) z;
00511     data.nx = *lx;
00512     data.ny = *ny;
00513 
00514 // Call plfshades to do the actual work - plf2ops_col_major() returns a collection
00515 //   of functions to access the data in fortran style.
00516     plfshades( plf2ops_grid_col_major(), &data, *nx, *ny, NULL,
00517         *xmin, *xmax, *ymin, *ymax,
00518         clevel, *nlevel, *fill_width,
00519         *cont_color, *cont_width,
00520         c_plfill, rect, pltr, (void *) ftr );
00521 }
00522 
00523 void
00524 PLGRIDDATA( PLFLT *x, PLFLT *y, PLFLT *z, PLINT *npts,
00525             PLFLT *xg, PLINT *nptsx, PLFLT *yg, PLINT *nptsy,
00526             PLFLT *zg, PLINT *type, PLFLT *data, PLINT *lx )
00527 {
00528     PLFLT **a;
00529     int   i, j;
00530 
00531     plAlloc2dGrid( &a, *nptsx, *nptsy );
00532 
00533     c_plgriddata( x, y, z, *npts,
00534         xg, *nptsx, yg, *nptsy,
00535         a, *type, *data );
00536 
00537     for ( i = 0; i < *nptsx; i++ )
00538     {
00539         for ( j = 0; j < *nptsy; j++ )
00540         {
00541             zg[i + j * *lx] = a[i][j];
00542         }
00543     }
00544 
00545 // Clean up memory allocated for a
00546     plFree2dGrid( a, *nptsx, *nptsy );
00547 }
00548 
00549 void
00550 PLIMAGEFR07( PLFLT *idata, PLINT *nx, PLINT *ny,
00551              PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00552              PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax,
00553              PLINT *lx )
00554 {
00555     int   i, j;
00556     PLFLT **pidata;
00557 
00558     plAlloc2dGrid( &pidata, *nx, *ny );
00559 
00560     for ( i = 0; i < *nx; i++ )
00561     {
00562         for ( j = 0; j < *ny; j++ )
00563         {
00564             pidata[i][j] = idata[i + j * ( *lx )];
00565         }
00566     }
00567 
00568     c_plimagefr( (const PLFLT **) pidata, *nx, *ny,
00569         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00570         *valuemin, *valuemax, pltr0, NULL );
00571 
00572     plFree2dGrid( pidata, *nx, *ny );
00573 }
00574 
00575 void
00576 PLIMAGEFR17( PLFLT *idata, PLINT *nx, PLINT *ny,
00577              PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00578              PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax,
00579              PLFLT *xg, PLFLT *yg, PLINT *lx )
00580 {
00581     int     i, j;
00582     PLFLT   **pidata;
00583     PLcGrid cgrid;
00584 
00585     plAlloc2dGrid( &pidata, *nx, *ny );
00586 
00587     cgrid.nx = ( *nx ) + 1;
00588     cgrid.ny = ( *ny ) + 1;
00589     cgrid.xg = xg;
00590     cgrid.yg = yg;
00591 
00592     for ( i = 0; i < *nx; i++ )
00593     {
00594         for ( j = 0; j < *ny; j++ )
00595         {
00596             pidata[i][j] = idata[i + j * ( *lx )];
00597         }
00598     }
00599 
00600     c_plimagefr( (const PLFLT **) pidata, *nx, *ny,
00601         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00602         *valuemin, *valuemax, pltr1, (void *) &cgrid );
00603 
00604     plFree2dGrid( pidata, *nx, *ny );
00605 }
00606 
00607 void
00608 PLIMAGEFR27( PLFLT *idata, PLINT *nx, PLINT *ny,
00609              PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00610              PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax,
00611              PLFLT *xg, PLFLT *yg, PLINT *lx )
00612 {
00613     int      i, j;
00614     PLFLT    **pidata;
00615     PLcGrid2 cgrid2;
00616 
00617     plAlloc2dGrid( &pidata, *nx, *ny );
00618     plAlloc2dGrid( &cgrid2.xg, ( *nx ) + 1, ( *ny ) + 1 );
00619     plAlloc2dGrid( &cgrid2.yg, ( *nx ) + 1, ( *ny ) + 1 );
00620 
00621     cgrid2.nx = ( *nx ) + 1;
00622     cgrid2.ny = ( *ny ) + 1;
00623     for ( i = 0; i <= *nx; i++ )
00624     {
00625         for ( j = 0; j <= *ny; j++ )
00626         {
00627             cgrid2.xg[i][j] = xg[i + j * ( ( *lx ) + 1 )];
00628             cgrid2.yg[i][j] = yg[i + j * ( ( *lx ) + 1 )];
00629         }
00630     }
00631 
00632     for ( i = 0; i < *nx; i++ )
00633     {
00634         for ( j = 0; j < *ny; j++ )
00635         {
00636             pidata[i][j] = idata[i + j * ( *lx )];
00637         }
00638     }
00639 
00640     c_plimagefr( (const PLFLT **) pidata, *nx, *ny,
00641         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00642         *valuemin, *valuemax, pltr2, (void *) &cgrid2 );
00643 
00644     plFree2dGrid( pidata, *nx, *ny );
00645     plFree2dGrid( cgrid2.xg, ( *nx ) + 1, ( *ny ) + 1 );
00646     plFree2dGrid( cgrid2.yg, ( *nx ) + 1, ( *ny ) + 1 );
00647 }
00648 
00649 void
00650 PLIMAGEFR7( PLFLT *idata, PLINT *nx, PLINT *ny,
00651             PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00652             PLFLT *zmin, PLFLT *zmax, PLFLT *valuemin, PLFLT *valuemax,
00653             PLFLT *ftr, PLINT *lx )
00654 {
00655     int   i, j;
00656     PLFLT **pidata;
00657 
00658     plAlloc2dGrid( &pidata, *nx, *ny );
00659 
00660     for ( i = 0; i < *nx; i++ )
00661     {
00662         for ( j = 0; j < *ny; j++ )
00663         {
00664             pidata[i][j] = idata[i + j * ( *lx )];
00665         }
00666     }
00667 
00668     c_plimagefr( (const PLFLT **) pidata, *nx, *ny,
00669         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00670         *valuemin, *valuemax, pltr, (void *) ftr );
00671 
00672     plFree2dGrid( pidata, *nx, *ny );
00673 }

Generated on Wed Oct 12 2011 20:42:23 for PLplot by  doxygen 1.7.1