PLplot  5.12.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 (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt)
 
static void plt3zz (PLINT x0, PLINT y0, PLINT dx, PLINT dy, PLINT flag, PLINT *init, PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT *u, PLINT *v, PLFLT *c)
 
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 (PLCHAR_VECTOR)
 
static void myabort (PLCHAR_VECTOR)
 
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 (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt)
 
void plfmesh (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt)
 
void c_plmeshc (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel)
 
void plfmeshc (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR 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 (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel)
 
void plfsurf3d (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel)
 
void c_plsurf3dl (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel, PLINT indexxmin, PLINT indexxmax, PLINT_VECTOR indexymin, PLINT_VECTOR indexymax)
 
void plfsurf3dl (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel, PLINT indexxmin, PLINT indexxmax, PLINT_VECTOR indexymin, PLINT_VECTOR indexymax)
 
void c_plot3d (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLBOOL side)
 
void plfplot3d (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLBOOL side)
 
void c_plot3dc (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel)
 
void plfplot3dc (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel)
 
void c_plot3dcl (PLFLT_VECTOR x, PLFLT_VECTOR y, PLFLT_MATRIX z, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel, PLINT indexxmin, PLINT indexxmax, PLINT_VECTOR indexymin, PLINT_VECTOR indexymax)
 
void plfplot3dcl (PLFLT_VECTOR x, PLFLT_VECTOR y, PLF2OPS zops, PLPointer zp, PLINT nx, PLINT ny, PLINT opt, PLFLT_VECTOR clevel, PLINT nlevel, PLINT PL_UNUSED(indexxmin), PLINT PL_UNUSED(indexxmax), PLINT_VECTOR PL_UNUSED(indexymin), PLINT_VECTOR 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 101 of file plot3d.c.

void c_plmesh ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt 
)

Definition at line 118 of file plot3d.c.

void c_plmeshc ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel 
)

Definition at line 150 of file plot3d.c.

void c_plot3d ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLBOOL  side 
)

Definition at line 860 of file plot3d.c.

void c_plot3dc ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel 
)

Definition at line 883 of file plot3d.c.

void c_plot3dcl ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel,
PLINT  indexxmin,
PLINT  indexxmax,
PLINT_VECTOR  indexymin,
PLINT_VECTOR  indexymax 
)

Definition at line 921 of file plot3d.c.

void c_plsurf3d ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel 
)

Definition at line 326 of file plot3d.c.

void c_plsurf3dl ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLFLT_MATRIX  z,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel,
PLINT  indexxmin,
PLINT  indexxmax,
PLINT_VECTOR  indexymin,
PLINT_VECTOR  indexymax 
)

Definition at line 389 of file plot3d.c.

static void freework ( void  )
static

Definition at line 2630 of file plot3d.c.

static void myabort ( PLCHAR_VECTOR  msg)
static

Definition at line 2662 of file plot3d.c.

static void myexit ( PLCHAR_VECTOR  msg)
static

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

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

Definition at line 2676 of file plot3d.c.

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

Definition at line 124 of file plot3d.c.

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

Definition at line 157 of file plot3d.c.

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

Definition at line 867 of file plot3d.c.

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

Definition at line 891 of file plot3d.c.

void plfplot3dcl ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel,
PLINT   PL_UNUSEDindexxmin,
PLINT   PL_UNUSEDindexxmax,
PLINT_VECTOR   PL_UNUSEDindexymin,
PLINT_VECTOR   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 970 of file plot3d.c.

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

Definition at line 334 of file plot3d.c.

void plfsurf3dl ( PLFLT_VECTOR  x,
PLFLT_VECTOR  y,
PLF2OPS  zops,
PLPointer  zp,
PLINT  nx,
PLINT  ny,
PLINT  opt,
PLFLT_VECTOR  clevel,
PLINT  nlevel,
PLINT  indexxmin,
PLINT  indexxmax,
PLINT_VECTOR  indexymin,
PLINT_VECTOR  indexymax 
)

Definition at line 398 of file plot3d.c.

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

Definition at line 1568 of file plot3d.c.

static void plgrid3 ( PLFLT  tick)
static

Definition at line 1829 of file plot3d.c.

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

Definition at line 1946 of file plot3d.c.

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

Definition at line 1961 of file plot3d.c.

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

Definition at line 2035 of file plot3d.c.

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

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

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

Definition at line 1551 of file plot3d.c.

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

Definition at line 2767 of file plot3d.c.

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

Definition at line 1705 of file plot3d.c.

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

Definition at line 1622 of file plot3d.c.

static void savehipoint ( PLINT  px,
PLINT  py 
)
static

Definition at line 2546 of file plot3d.c.

static void savelopoint ( PLINT  px,
PLINT  py 
)
static

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

static void swaploview ( void  )
static

Definition at line 2610 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.