PLplot: plot3d.c File Reference

PLplot 5.15.0

Macros | Functions | Variables
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 PLINT * | oldhiview = NULL
static PLINT * | oldloview = NULL
static PLINT * | newhiview = NULL
static PLINT * | newloview = NULL
static PLINT * | utmp = NULL
static PLINT * | vtmp = NULL
static PLFLT * | ctmp = 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

## ◆ BINC

#define BINC 50

Definition at line 30 of file plot3d.c.

## ◆ max3

#define max3 | ( |  | a,
|  |  | b,
|  |  | c
| ) |  | ( MAX( ( MAX( a, b ) ), c ) )

## ◆ min3

#define min3 | ( |  | a,
|  |  | b,
|  |  | c
| ) |  | ( MIN( ( MIN( a, b ) ), c ) )

## ◆ NPTS

#define NPTS 100

## Function Documentation

## ◆ c_pllightsource()

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

Definition at line 101 of file plot3d.c.

## ◆ c_plmesh()

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.

## ◆ c_plmeshc()

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.

## ◆ c_plot3d()

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.

## ◆ c_plot3dc()

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.

## ◆ c_plot3dcl()

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.

## ◆ c_plsurf3d()

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.

## ◆ c_plsurf3dl()

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.

## ◆ freework()

static void freework | ( | void |  | ) |
| static

Definition at line 2630 of file plot3d.c.

## ◆ myabort()

static void myabort | ( | PLCHAR_VECTOR | msg | ) |
| static

Definition at line 2662 of file plot3d.c.

## ◆ myexit()

static void myexit | ( | PLCHAR_VECTOR | msg | ) |
| static

Definition at line 2648 of file plot3d.c.

## ◆ pl3cut()

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.

## ◆ plabv()

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

Definition at line 2676 of file plot3d.c.

## ◆ plfmesh()

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.

## ◆ plfmeshc()

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.

## ◆ plfplot3d()

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.

## ◆ plfplot3dc()

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.

## ◆ plfplot3dcl()

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

  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
  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.

## ◆ plfsurf3d()

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.

## ◆ plfsurf3dl()

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.

## ◆ plGetAngleToLight()

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

Definition at line 1568 of file plot3d.c.

## ◆ plgrid3()

static void plgrid3 | ( | PLFLT | tick | ) |
| static

Definition at line 1829 of file plot3d.c.

## ◆ plnxtv()

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

Definition at line 1946 of file plot3d.c.

## ◆ plnxtvhi()

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

Definition at line 1961 of file plot3d.c.

## ◆ plnxtvhi_draw()

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

Definition at line 2035 of file plot3d.c.

## ◆ plnxtvlo()

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

Definition at line 2272 of file plot3d.c.

## ◆ plP_clip_poly()

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

Definition at line 166 of file plot3d.c.

## ◆ plP_draw3d()

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

Definition at line 2253 of file plot3d.c.

## ◆ plP_gzback()

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

Definition at line 1551 of file plot3d.c.

## ◆ plRotationShear()

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

Definition at line 2767 of file plot3d.c.

## ◆ plside3()

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.

## ◆ plt3zz()

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.

## ◆ savehipoint()

static void savehipoint | ( | PLINT | px,
|  | PLINT | py
| ) |  |
| static

Definition at line 2546 of file plot3d.c.

## ◆ savelopoint()

static void savelopoint | ( | PLINT | px,
|  | PLINT | py
| ) |  |
| static

Definition at line 2567 of file plot3d.c.

## ◆ shade_triangle()

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.

## ◆ swaphiview()

static void swaphiview | ( | void |  | ) |
| static

Definition at line 2596 of file plot3d.c.

## ◆ swaploview()

static void swaploview | ( | void |  | ) |
| static

Definition at line 2610 of file plot3d.c.

## Variable Documentation

## ◆ ctmp

PLFLT* ctmp = NULL
| static

Definition at line 44 of file plot3d.c.

## ◆ falsecolor

PLINT falsecolor = 0
| static

Definition at line 51 of file plot3d.c.

## ◆ fc_maxz

PLFLT fc_maxz
| static

Definition at line 52 of file plot3d.c.

## ◆ fc_minz

PLFLT fc_minz
| static

Definition at line 52 of file plot3d.c.

## ◆ mhi

PLINT mhi
| static

Definition at line 46 of file plot3d.c.

## ◆ mlo

PLINT mlo
| static

Definition at line 47 of file plot3d.c.

## ◆ newhisize

PLINT newhisize
| static

Definition at line 46 of file plot3d.c.

## ◆ newhiview

PLINT* newhiview = NULL
| static

Definition at line 40 of file plot3d.c.

## ◆ newlosize

PLINT newlosize
| static

Definition at line 47 of file plot3d.c.

## ◆ newloview

PLINT* newloview = NULL
| static

Definition at line 41 of file plot3d.c.

## ◆ oldhiview

PLINT* oldhiview = NULL
| static

Definition at line 38 of file plot3d.c.

## ◆ oldloview

PLINT* oldloview = NULL
| static

Definition at line 39 of file plot3d.c.

## ◆ pl3mode

PLINT pl3mode = 0
| static

Definition at line 32 of file plot3d.c.

## ◆ pl3upv

PLINT pl3upv = 1
| static

Definition at line 33 of file plot3d.c.

## ◆ utmp

PLINT* utmp = NULL
| static

Definition at line 42 of file plot3d.c.

## ◆ vtmp

PLINT* vtmp = NULL
| static

Definition at line 43 of file plot3d.c.

## ◆ xlight

PLFLT xlight
| static

Definition at line 50 of file plot3d.c.

## ◆ xxhi

PLINT xxhi
| static

Definition at line 46 of file plot3d.c.

## ◆ xxlo

PLINT xxlo
| static

Definition at line 47 of file plot3d.c.

## ◆ ylight

PLFLT ylight
| static

Definition at line 50 of file plot3d.c.

## ◆ zbcol

PLINT zbcol
| static

Definition at line 35 of file plot3d.c.

## ◆ zbflg

PLINT zbflg = 0
| static

Definition at line 35 of file plot3d.c.

## ◆ zbtck

PLFLT zbtck
| static

Definition at line 36 of file plot3d.c.

## ◆ zbwidth

PLFLT zbwidth
| static

Definition at line 36 of file plot3d.c.

## ◆ zlight

PLFLT zlight
| static

Definition at line 50 of file plot3d.c.