Defines | Functions | Variables

plot3d.c File Reference

#include "plplotP.h"

Go to the source code of this file.

Defines

#define BINC   50
#define NPTS   100
#define min3(a, b, c)   ( MIN( ( MIN( a, b ) ), c ) )
#define max3(a, b, c)   ( MAX( ( MAX( a, b ) ), c ) )

Functions

static void plgrid3 (PLFLT)
static void plnxtv (PLINT *, PLINT *, PLFLT *, PLINT, PLINT)
static void plside3 (PLFLT *, PLFLT *, PLF2OPS, PLPointer, PLINT, PLINT, PLINT)
static void plt3zz (PLINT, PLINT, PLINT, PLINT, PLINT, PLINT *, PLFLT *, PLFLT *, PLF2OPS, PLPointer, PLINT, PLINT, PLINT *, PLINT *, PLFLT *)
static void plnxtvhi (PLINT *, PLINT *, PLFLT *, PLINT, PLINT)
static void plnxtvlo (PLINT *, PLINT *, PLFLT *, PLINT, PLINT)
static void plnxtvhi_draw (PLINT *u, PLINT *v, PLFLT *c, PLINT n)
static void savehipoint (PLINT, PLINT)
static void savelopoint (PLINT, PLINT)
static void swaphiview (void)
static void swaploview (void)
static void myexit (char *)
static void myabort (char *)
static void freework (void)
static int plabv (PLINT, PLINT, PLINT, PLINT, PLINT, PLINT)
static void pl3cut (PLINT, PLINT, PLINT, PLINT, PLINT, PLINT, PLINT, PLINT, PLINT *, PLINT *)
static PLFLT plGetAngleToLight (PLFLT *x, PLFLT *y, PLFLT *z)
static void plP_draw3d (PLINT x, PLINT y, PLFLT *c, PLINT j, PLINT move)
static void plxyindexlimits (PLINT instart, PLINT inn, PLINT *inarray_min, PLINT *inarray_max, PLINT *outstart, PLINT *outn, PLINT outnmax, PLINT *outarray_min, PLINT *outarray_max)
void c_pllightsource (PLFLT x, PLFLT y, PLFLT z)
void c_plmesh (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt)
void plfmesh (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt)
void c_plmeshc (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
void plfmeshc (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
int plP_clip_poly (int Ni, PLFLT *Vi[3], int axis, PLFLT dir, PLFLT offset)
static void shade_triangle (PLFLT x0, PLFLT y0, PLFLT z0, PLFLT x1, PLFLT y1, PLFLT z1, PLFLT x2, PLFLT y2, PLFLT z2)
void c_plsurf3d (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
void plfsurf3d (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
void c_plsurf3dl (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax)
void plfsurf3dl (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax)
void c_plot3d (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLBOOL side)
void plfplot3d (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLBOOL side)
void c_plot3dc (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
void plfplot3dc (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel)
void c_plot3dcl (const PLFLT *x, const PLFLT *y, const PLFLT **z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax)
void plfplot3dcl (const PLFLT *x, const PLFLT *y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, const PLINT *indexymin, const PLINT *indexymax)
void plP_gzback (PLINT **zbf, PLINT **zbc, PLFLT **zbt, PLINT **zbw)
void plRotationShear (PLFLT *xFormMatrix, PLFLT *rotation, PLFLT *shear, PLFLT *stride)

Variables

static PLINT pl3mode = 0
static PLINT pl3upv = 1
static PLINT zbflg = 0
static PLINT zbcol
static PLINT zbwidth
static PLFLT zbtck
static PLINToldhiview = NULL
static PLINToldloview = NULL
static PLINTnewhiview = NULL
static PLINTnewloview = NULL
static PLINTutmp = NULL
static PLINTvtmp = NULL
static PLFLTctmp = NULL
static PLINT mhi
static PLINT xxhi
static PLINT newhisize
static PLINT mlo
static PLINT xxlo
static PLINT newlosize
static PLFLT xlight
static PLFLT ylight
static PLFLT zlight
static PLINT falsecolor = 0
static PLFLT fc_minz
static PLFLT fc_maxz

Detailed Description

3d plot routines.

Definition in file plot3d.c.


Define Documentation

#define BINC   50

Definition at line 32 of file plot3d.c.

#define max3 (   a,
  b,
  c 
)    ( MAX( ( MAX( a, b ) ), c ) )
#define min3 (   a,
  b,
  c 
)    ( MIN( ( MIN( a, b ) ), c ) )
#define NPTS   100

Function Documentation

void c_pllightsource ( PLFLT  x,
PLFLT  y,
PLFLT  z 
)

Definition at line 101 of file plot3d.c.

void c_plmesh ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt 
)

Definition at line 118 of file plot3d.c.

void c_plmeshc ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 150 of file plot3d.c.

void c_plot3d ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLBOOL  side 
)

Definition at line 859 of file plot3d.c.

void c_plot3dc ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 882 of file plot3d.c.

void c_plot3dcl ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel,
PLINT  ixstart,
PLINT  ixn,
const PLINT indexymin,
const PLINT indexymax 
)

Definition at line 920 of file plot3d.c.

void c_plsurf3d ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 326 of file plot3d.c.

void c_plsurf3dl ( const PLFLT x,
const PLFLT y,
const PLFLT **  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel,
PLINT  ixstart,
PLINT  ixn,
const PLINT indexymin,
const PLINT indexymax 
)

Definition at line 389 of file plot3d.c.

static void freework ( void   )  [static]

Definition at line 2629 of file plot3d.c.

static void myabort ( char *  msg  )  [static]

Definition at line 2661 of file plot3d.c.

static void myexit ( char *  msg  )  [static]

Definition at line 2647 of file plot3d.c.

static void pl3cut ( PLINT  sx1,
PLINT  sy1,
PLINT  sx2,
PLINT  sy2,
PLINT  su1,
PLINT  sv1,
PLINT  su2,
PLINT  sv2,
PLINT cx,
PLINT cy 
) [static]

Definition at line 2700 of file plot3d.c.

static int plabv ( PLINT  px,
PLINT  py,
PLINT  sx1,
PLINT  sy1,
PLINT  sx2,
PLINT  sy2 
) [static]

Definition at line 2675 of file plot3d.c.

void plfmesh ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt 
)

Definition at line 124 of file plot3d.c.

void plfmeshc ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 157 of file plot3d.c.

void plfplot3d ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLBOOL  side 
)

Definition at line 866 of file plot3d.c.

void plfplot3dc ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 890 of file plot3d.c.

void plfplot3dcl ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel,
PLINT  ixstart,
PLINT  ixn,
const PLINT indexymin,
const PLINT indexymax 
)

Plots a 3-d representation of the virtual function z, which is represented by zops and zp.

Parameters:
x The x values are stored as x[0..nx-1]
y The y values are stored as y[0..ny-1]
zops Pointer to a plf2ops_t structure of function pointers (see plf2opts_t in plplot.h) which define how to perform various manipulations (including retrieval) on the elements of the the 2D data field pointed to by zp. Pointers suitable for passing as zops can be obtained for some predefined types of 2-d data storage by calling one of the plf2ops_*() functions (see plf2ops.c) or you can create your own set for arbitrary 2-d storage formats.
zp Pointer to 2D data field. This pointer is passed to the functions of zops whenever the 2D field needs to be manipulated. The combination of zops and zp provides total flexibility in how the underlying data values are managed.
nx The number of values in x.
ny The number of values in y.
opt Specifies options for the plot. It can be a bitwise OR-ing of these:

  • DRAW_LINEX : Draw lines parallel to x-axis
  • DRAW_LINEY : Draw lines parallel to y-axis
  • DRAW_LINEXY: Draw lines parallel to both axes
  • MAG_COLOR: Magnitude coloring of wire frame
  • BASE_CONT: Draw contour at bottom xy plane
  • TOP_CONT: Draw contour at top xy plane (not yet)
  • DRAW_SIDES: Draw sides around the plot
  • MESH: Draw the "under" side of the plot or any bitwise OR'd combination, e.g. "MAG_COLOR | DRAW_LINEX"
clevel z values at which to draw contours
nlevel Number of values in clevels
ixstart Index of first x coordinate to include in plot
ixn Number of x coordinates to include in plot
indexymin Array which specifies the min y index for each x index in range ixstart, ixn.
indexymax Array which specifies the max y index for each x coordinate (following the convention that the upper range limit is one more than actual index limit) for an x index range of ixstart, ixn.

Definition at line 971 of file plot3d.c.

void plfsurf3d ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel 
)

Definition at line 334 of file plot3d.c.

void plfsurf3dl ( const PLFLT x,
const PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
const PLFLT clevel,
PLINT  nlevel,
PLINT  ixstart,
PLINT  ixn,
const PLINT indexymin,
const PLINT indexymax 
)

Definition at line 398 of file plot3d.c.

static PLFLT plGetAngleToLight ( PLFLT x,
PLFLT y,
PLFLT z 
) [static]

Definition at line 1567 of file plot3d.c.

static void plgrid3 ( PLFLT  tick  )  [static]

Definition at line 1828 of file plot3d.c.

static void plnxtv ( PLINT u,
PLINT v,
PLFLT c,
PLINT  n,
PLINT  init 
) [static]

Definition at line 1945 of file plot3d.c.

static void plnxtvhi ( PLINT u,
PLINT v,
PLFLT c,
PLINT  n,
PLINT  init 
) [static]

Definition at line 1960 of file plot3d.c.

static void plnxtvhi_draw ( PLINT u,
PLINT v,
PLFLT c,
PLINT  n 
) [static]

Definition at line 2034 of file plot3d.c.

static void plnxtvlo ( PLINT u,
PLINT v,
PLFLT c,
PLINT  n,
PLINT  init 
) [static]

Definition at line 2271 of file plot3d.c.

int plP_clip_poly ( int  Ni,
PLFLT Vi[3],
int  axis,
PLFLT  dir,
PLFLT  offset 
)

Definition at line 166 of file plot3d.c.

static void plP_draw3d ( PLINT  x,
PLINT  y,
PLFLT c,
PLINT  j,
PLINT  move 
) [static]

Definition at line 2252 of file plot3d.c.

void plP_gzback ( PLINT **  zbf,
PLINT **  zbc,
PLFLT **  zbt,
PLINT **  zbw 
)

Definition at line 1550 of file plot3d.c.

void plRotationShear ( PLFLT xFormMatrix,
PLFLT rotation,
PLFLT shear,
PLFLT stride 
)

Definition at line 2766 of file plot3d.c.

static void plside3 ( PLFLT x,
PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt 
) [static]

Definition at line 1704 of file plot3d.c.

static void plt3zz ( PLINT  x0,
PLINT  y0,
PLINT  dx,
PLINT  dy,
PLINT  flag,
PLINT init,
PLFLT x,
PLFLT y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT u,
PLINT v,
PLFLT c 
) [static]

Definition at line 1621 of file plot3d.c.

static void plxyindexlimits ( PLINT  instart,
PLINT  inn,
PLINT inarray_min,
PLINT inarray_max,
PLINT outstart,
PLINT outn,
PLINT  outnmax,
PLINT outarray_min,
PLINT outarray_max 
) [static]

Definition at line 1475 of file plot3d.c.

static void savehipoint ( PLINT  px,
PLINT  py 
) [static]

Definition at line 2545 of file plot3d.c.

static void savelopoint ( PLINT  px,
PLINT  py 
) [static]

Definition at line 2566 of file plot3d.c.

static void shade_triangle ( PLFLT  x0,
PLFLT  y0,
PLFLT  z0,
PLFLT  x1,
PLFLT  y1,
PLFLT  z1,
PLFLT  x2,
PLFLT  y2,
PLFLT  z2 
) [static]

Definition at line 262 of file plot3d.c.

static void swaphiview ( void   )  [static]

Definition at line 2595 of file plot3d.c.

static void swaploview ( void   )  [static]

Definition at line 2609 of file plot3d.c.


Variable Documentation

PLFLT* ctmp = NULL [static]

Definition at line 46 of file plot3d.c.

PLINT falsecolor = 0 [static]

Definition at line 53 of file plot3d.c.

PLFLT fc_maxz [static]

Definition at line 54 of file plot3d.c.

PLFLT fc_minz [static]

Definition at line 54 of file plot3d.c.

PLINT mhi [static]

Definition at line 48 of file plot3d.c.

PLINT mlo [static]

Definition at line 49 of file plot3d.c.

PLINT newhisize [static]

Definition at line 48 of file plot3d.c.

PLINT* newhiview = NULL [static]

Definition at line 42 of file plot3d.c.

PLINT newlosize [static]

Definition at line 49 of file plot3d.c.

PLINT* newloview = NULL [static]

Definition at line 43 of file plot3d.c.

PLINT* oldhiview = NULL [static]

Definition at line 40 of file plot3d.c.

PLINT* oldloview = NULL [static]

Definition at line 41 of file plot3d.c.

PLINT pl3mode = 0 [static]

Definition at line 34 of file plot3d.c.

PLINT pl3upv = 1 [static]

Definition at line 35 of file plot3d.c.

PLINT* utmp = NULL [static]

Definition at line 44 of file plot3d.c.

PLINT* vtmp = NULL [static]

Definition at line 45 of file plot3d.c.

PLFLT xlight [static]

Definition at line 52 of file plot3d.c.

PLINT xxhi [static]

Definition at line 48 of file plot3d.c.

PLINT xxlo [static]

Definition at line 49 of file plot3d.c.

PLFLT ylight [static]

Definition at line 52 of file plot3d.c.

PLINT zbcol [static]

Definition at line 37 of file plot3d.c.

PLINT zbflg = 0 [static]

Definition at line 37 of file plot3d.c.

PLFLT zbtck [static]

Definition at line 38 of file plot3d.c.

PLINT zbwidth [static]

Definition at line 37 of file plot3d.c.

PLFLT zlight [static]

Definition at line 52 of file plot3d.c.