1
/* $Id: sc3d.c,v 1.3 2006/05/13 07:09:48 airwin Exp $
3
Stub routines for 3d plots.
5
Copyright (C) 2004 Alan W. Irwin
7
This file is part of PLplot.
9
PLplot is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Library Public License as published
11
by the Free Software Foundation; either version 2 of the License, or
12
(at your option) any later version.
14
PLplot is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public License
20
along with PLplot; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28
PLOT3DC(PLFLT *x, PLFLT *y, PLFLT *z,
29
PLINT *nx, PLINT *ny, PLINT *opt,
30
PLFLT *clevel, PLINT *nlevel, PLINT *lx)
35
/* Create a vectored a array from transpose of the fortran z array. */
36
plAlloc2dGrid(&a, *nx, *ny);
37
for (i = 0; i < *nx; i++) {
38
for (j = 0; j < *ny; j++) {
39
a[i][j] = z[i +j * *lx];
43
c_plot3dc(x, y, a, *nx, *ny, *opt, clevel, *nlevel);
45
/* Clean up memory allocated for a */
46
plFree2dGrid(a, *nx, *ny);
51
PLSURF3D(PLFLT *x, PLFLT *y, PLFLT *z,
52
PLINT *nx, PLINT *ny, PLINT *opt,
53
PLFLT *clevel, PLINT *nlevel, PLINT *lx)
58
/* Create the vectored C matrix from the Fortran matrix */
59
/* To make things easy we save a temporary copy of the transpose of the
60
Fortran matrix, so that the first dimension of z corresponds to the x
63
if ( ! (temp = (PLFLT **) malloc((size_t) * nx * sizeof(PLFLT *)))) {
64
plabort("PLSURF3D: Out of memory");
68
for (i = 0; i < *nx; i++) {
69
if ( ! (temp[i] = (PLFLT *) malloc((size_t) * ny * sizeof(PLFLT)))) {
72
for (ii = 0; ii < i-1; ii++)
73
free((void *) temp[i]);
75
plabort("PLSURF3D: Out of memory");
80
for (i = 0; i < *nx; i++)
81
for (j = 0; j < *ny; j++)
82
temp[i][j] = *(z + j * *lx + i);
84
c_plsurf3d(x, y, temp, *nx, *ny, *opt, clevel, *nlevel);
86
for (i = 0; i < *nx; i++)
87
free((void *) temp[i]);
93
PLMESH(PLFLT *x, PLFLT *y, PLFLT *z,
94
PLINT *nx, PLINT *ny, PLINT *opt, PLINT *lx)
96
PLINT optlocal, nlevel = 0;
99
optlocal = *opt | MESH;
100
PLOT3DC(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx);
104
PLMESHC(PLFLT *x, PLFLT *y, PLFLT *z,
105
PLINT *nx, PLINT *ny, PLINT *opt,
106
PLFLT *clevel, PLINT *nlevel, PLINT *lx)
109
optlocal = *opt | MESH;
110
PLOT3DC(x, y, z, nx, ny, &optlocal, clevel, nlevel, lx);
115
PLOT3D(PLFLT *x, PLFLT *y, PLFLT *z,
116
PLINT *nx, PLINT *ny, PLINT *opt, PLBOOL *side, PLINT *lx)
118
PLINT optlocal, nlevel = 0;
121
optlocal = *opt | (*side != 0 ? DRAW_SIDES : 0);
122
PLOT3DC(x, y, z, nx, ny, &optlocal, &clevel, &nlevel, lx);