PLplot: plot3d.c File Reference

PLplot 5.10.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 (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 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

#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 *const * | 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 *const * | 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 *const * | z,
|  | PLINT | nx,
|  | PLINT | ny,
|  | PLINT | opt,
|  | PLBOOL | side
| ) |  |

Definition at line 858 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 881 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 919 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 326 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 389 of file plot3d.c.

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

Definition at line 2628 of file plot3d.c.

static void myabort | ( | const char * | msg | ) |
| static

Definition at line 2660 of file plot3d.c.

static void myexit | ( | const char * | msg | ) |
| static

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

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

Definition at line 2674 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 865 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 889 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

  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 968 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 | indexxmin,
|  | PLINT | indexxmax,
|  | 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 1566 of file plot3d.c.

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

Definition at line 1827 of file plot3d.c.

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

Definition at line 1944 of file plot3d.c.

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

Definition at line 1959 of file plot3d.c.

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

Definition at line 2033 of file plot3d.c.

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

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

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

Definition at line 1549 of file plot3d.c.

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

Definition at line 2765 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 1703 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 1620 of file plot3d.c.

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

Definition at line 2544 of file plot3d.c.

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

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

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

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

PLFLT zbwidth
| static

Definition at line 38 of file plot3d.c.

PLFLT zlight
| static

Definition at line 52 of file plot3d.c.