PLplot  5.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plot3d.c File Reference
#include "plplotP.h"

Go to the source code of this file.

Macros

#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 (const PLFLT *, const PLFLT *, PLF2OPS, PLPointer, PLINT, PLINT, PLINT)
static void plt3zz (PLINT, PLINT, PLINT, PLINT, PLINT, PLINT *, const PLFLT *, const 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 (const char *)
static void myabort (const 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)
void c_pllightsource (PLFLT x, PLFLT y, PLFLT z)
void c_plmesh (const PLFLT *x, const PLFLT *y, const PLFLT *const *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 *const *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 *const *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 *const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT indexxmin, PLINT indexxmax, 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 indexxmin, PLINT indexxmax, const PLINT *indexymin, const PLINT *indexymax)
void c_plot3d (const PLFLT *x, const PLFLT *y, const PLFLT *const *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 *const *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 *const *z, PLINT nx, PLINT ny, PLINT opt, const PLFLT *clevel, PLINT nlevel, PLINT indexxmin, PLINT indexxmax, 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 PL_UNUSED(indexxmin), PLINT PL_UNUSED(indexxmax), const PLINT *PL_UNUSED(indexymin), const PLINT *PL_UNUSED(indexymax))
void plP_gzback (PLINT **zbf, PLINT **zbc, PLFLT **zbt, PLFLT **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 PLFLT zbtck
static PLFLT zbwidth
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.

Macro Definition Documentation

#define BINC   50

Definition at line 30 of file plot3d.c.

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

Function Documentation

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

Definition at line 99 of file plot3d.c.

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

Definition at line 116 of file plot3d.c.

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

Definition at line 148 of file plot3d.c.

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

Definition at line 856 of file plot3d.c.

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

Definition at line 879 of file plot3d.c.

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

Definition at line 917 of file plot3d.c.

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

Definition at line 324 of file plot3d.c.

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

Definition at line 387 of file plot3d.c.

static void freework ( void  )
static

Definition at line 2626 of file plot3d.c.

static void myabort ( const char *  msg)
static

Definition at line 2658 of file plot3d.c.

static void myexit ( const char *  msg)
static

Definition at line 2644 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 2697 of file plot3d.c.

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

Definition at line 2672 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 122 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 155 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 863 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 887 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   PL_UNUSEDindexxmin,
PLINT   PL_UNUSEDindexxmax,
const PLINT PL_UNUSEDindexymin,
const PLINT PL_UNUSEDindexymax 
)

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

Parameters
xThe x values are stored as x[0..nx-1]
yThe y values are stored as y[0..ny-1]
zopsPointer 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.
zpPointer 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.
nxThe number of values in x.
nyThe number of values in y.
optSpecifies 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"
clevelz values at which to draw contours
nlevelNumber of values in clevels
PL_UNUSED(indexxmin ) Not used.
PL_UNUSED(indexxmax ) Not used.
PL_UNUSED(indexymin ) Not used.
PL_UNUSED(indexymax ) Not used.

Definition at line 966 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 332 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  indexxmin,
PLINT  indexxmax,
const PLINT indexymin,
const PLINT indexymax 
)

Definition at line 396 of file plot3d.c.

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

Definition at line 1564 of file plot3d.c.

static void plgrid3 ( PLFLT  tick)
static

Definition at line 1825 of file plot3d.c.

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

Definition at line 1942 of file plot3d.c.

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

Definition at line 1957 of file plot3d.c.

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

Definition at line 2031 of file plot3d.c.

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

Definition at line 2268 of file plot3d.c.

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

Definition at line 164 of file plot3d.c.

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

Definition at line 2249 of file plot3d.c.

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

Definition at line 1547 of file plot3d.c.

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

Definition at line 2763 of file plot3d.c.

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

Definition at line 1701 of file plot3d.c.

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

Definition at line 1618 of file plot3d.c.

static void savehipoint ( PLINT  px,
PLINT  py 
)
static

Definition at line 2542 of file plot3d.c.

static void savelopoint ( PLINT  px,
PLINT  py 
)
static

Definition at line 2563 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 260 of file plot3d.c.

static void swaphiview ( void  )
static

Definition at line 2592 of file plot3d.c.

static void swaploview ( void  )
static

Definition at line 2606 of file plot3d.c.

Variable Documentation

PLFLT* ctmp = NULL
static

Definition at line 44 of file plot3d.c.

PLINT falsecolor = 0
static

Definition at line 51 of file plot3d.c.

PLFLT fc_maxz
static

Definition at line 52 of file plot3d.c.

PLFLT fc_minz
static

Definition at line 52 of file plot3d.c.

PLINT mhi
static

Definition at line 46 of file plot3d.c.

PLINT mlo
static

Definition at line 47 of file plot3d.c.

PLINT newhisize
static

Definition at line 46 of file plot3d.c.

PLINT* newhiview = NULL
static

Definition at line 40 of file plot3d.c.

PLINT newlosize
static

Definition at line 47 of file plot3d.c.

PLINT* newloview = NULL
static

Definition at line 41 of file plot3d.c.

PLINT* oldhiview = NULL
static

Definition at line 38 of file plot3d.c.

PLINT* oldloview = NULL
static

Definition at line 39 of file plot3d.c.

PLINT pl3mode = 0
static

Definition at line 32 of file plot3d.c.

PLINT pl3upv = 1
static

Definition at line 33 of file plot3d.c.

PLINT* utmp = NULL
static

Definition at line 42 of file plot3d.c.

PLINT* vtmp = NULL
static

Definition at line 43 of file plot3d.c.

PLFLT xlight
static

Definition at line 50 of file plot3d.c.

PLINT xxhi
static

Definition at line 46 of file plot3d.c.

PLINT xxlo
static

Definition at line 47 of file plot3d.c.

PLFLT ylight
static

Definition at line 50 of file plot3d.c.

PLINT zbcol
static

Definition at line 35 of file plot3d.c.

PLINT zbflg = 0
static

Definition at line 35 of file plot3d.c.

PLFLT zbtck
static

Definition at line 36 of file plot3d.c.

PLFLT zbwidth
static

Definition at line 36 of file plot3d.c.

PLFLT zlight
static

Definition at line 50 of file plot3d.c.