BRL-CAD
dm-plot.c File Reference
#include "common.h"
#include <string.h>
#include "tcl.h"
#include "vmath.h"
#include "bn.h"
#include "mater.h"
#include "raytrace.h"
#include "dm.h"
#include "dm-plot.h"
#include "dm-Null.h"
#include "solid.h"
#include "plot3.h"
#include "./dm_private.h"
Include dependency graph for dm-plot.c:

Go to the source code of this file.

Macros

#define __USE_POSIX2   1
 
#define PLOTBOUND   1000.0 /* Max magnification in Rot matrix */
 

Functions

HIDDEN int plot_close (dm *dmp)
 
HIDDEN int plot_drawBegin (dm *dmp)
 
HIDDEN int plot_drawEnd (dm *dmp)
 
HIDDEN int plot_loadMatrix (dm *dmp, fastf_t *mat, int which_eye)
 
HIDDEN int plot_drawVList (dm *dmp, struct bn_vlist *vp)
 
HIDDEN int plot_draw (dm *dmp, struct bn_vlist *(*callback_function)(void *), void **data)
 
HIDDEN int plot_normal (dm *dmp)
 
HIDDEN int plot_drawString2D (dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
 
HIDDEN int plot_drawLine2D (dm *dmp, fastf_t xpos1, fastf_t ypos1, fastf_t xpos2, fastf_t ypos2)
 
HIDDEN int plot_drawLine3D (dm *dmp, point_t pt1, point_t pt2)
 
HIDDEN int plot_drawLines3D (dm *dmp, int npoints, point_t *points, int sflag)
 
HIDDEN int plot_drawPoint2D (dm *dmp, fastf_t x, fastf_t y)
 
HIDDEN int plot_setFGColor (dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
 
HIDDEN int plot_setBGColor (dm *dmp, unsigned char r, unsigned char g, unsigned char b)
 
HIDDEN int plot_setLineAttr (dm *dmp, int width, int style)
 
HIDDEN int plot_debug (dm *dmp, int lvl)
 
HIDDEN int plot_logfile (dm *dmp, const char *filename)
 
HIDDEN int plot_setWinBounds (dm *dmp, fastf_t *w)
 
dmplot_open (Tcl_Interp *interp, int argc, const char *argv[])
 

Variables

struct plot_vars head_plot_vars
 
dm dm_plot
 

Detailed Description

An unsatisfying (but useful) hack to allow GED to generate UNIX-plot files that not only contain the drawn objects, but also contain the faceplate display as well. Mostly, a useful hack for making viewgraphs and photographs of an editing session. We assume that the UNIX-plot filter used can at least discard the non-standard extension to specify color (a Doug Gwyn addition).

Definition in file dm-plot.c.

Macro Definition Documentation

#define __USE_POSIX2   1

Definition at line 33 of file dm-plot.c.

#define PLOTBOUND   1000.0 /* Max magnification in Rot matrix */

Definition at line 56 of file dm-plot.c.

Function Documentation

HIDDEN int plot_close ( dm dmp)

Gracefully release the display.

Definition at line 66 of file dm-plot.c.

References bu_free(), bu_vls_free(), dm_internal::dm_pathName, dm_internal::dm_vars, and dm_vars::priv_vars.

Referenced by plot_open().

Here is the call graph for this function:

HIDDEN int plot_drawBegin ( dm dmp)

There are global variables which are parameters to this routine.

Definition at line 90 of file dm-plot.c.

HIDDEN int plot_drawEnd ( dm dmp)

Definition at line 102 of file dm-plot.c.

References dm_internal::dm_vars, pl_erase(), pl_flush(), and dm_vars::priv_vars.

Here is the call graph for this function:

HIDDEN int plot_loadMatrix ( dm dmp,
fastf_t mat,
int  which_eye 
)

Load a new transformation matrix. This will be followed by many calls to plot_draw().

Definition at line 120 of file dm-plot.c.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), dm_internal::dm_interp, dm_internal::dm_vars, and dm_vars::priv_vars.

Here is the call graph for this function:

HIDDEN int plot_drawVList ( dm dmp,
struct bn_vlist vp 
)

Set up for an object, transformed as indicated, and with an object center as specified. The ratio of object to screen size is passed in as a convenience.

Returns 0 if object could be drawn, !0 if object was omitted.

Definition at line 161 of file dm-plot.c.

References OSL::Strings::alpha, BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, BN_VLIST_POLY_DRAW, BN_VLIST_POLY_END, BN_VLIST_POLY_MOVE, BN_VLIST_POLY_START, BN_VLIST_POLY_VERTNORM, BN_VLIST_TRI_DRAW, BN_VLIST_TRI_END, BN_VLIST_TRI_MOVE, BN_VLIST_TRI_START, BN_VLIST_TRI_VERTNORM, BU_LIST_FOR, bn_vlist::cmd, delta, dm_internal::dm_clipmax, dm_internal::dm_clipmin, dm_internal::dm_perspective, dm_internal::dm_vars, bn_vlist::l, bn_vlist::nused, pl_3line(), pl_line(), dm_vars::priv_vars, bn_vlist::pt, rt_vlist_to_uplot(), SQRT_SMALL_FASTF, vclip(), X, Y, and Z.

Referenced by plot_draw().

Here is the call graph for this function:

HIDDEN int plot_draw ( dm dmp,
struct bn_vlist *(*)(void *)  callback_function,
void **  data 
)

Definition at line 305 of file dm-plot.c.

References plot_drawVList().

Here is the call graph for this function:

HIDDEN int plot_normal ( dm dmp)

Restore the display processor to a normal mode of operation (i.e., not scaled, rotated, displaced, etc.). Turns off windowing.

Definition at line 329 of file dm-plot.c.

HIDDEN int plot_drawString2D ( dm dmp,
const char *  str,
fastf_t  x,
fastf_t  y,
int  size,
int  use_aspect 
)

Output a string into the displaylist. The starting position of the beam is as specified.

Definition at line 343 of file dm-plot.c.

References dm_internal::dm_vars, pl_label(), pl_move(), and dm_vars::priv_vars.

Here is the call graph for this function:

HIDDEN int plot_drawLine2D ( dm dmp,
fastf_t  xpos1,
fastf_t  ypos1,
fastf_t  xpos2,
fastf_t  ypos2 
)

Definition at line 361 of file dm-plot.c.

References dm_internal::dm_vars, pl_cont(), pl_move(), and dm_vars::priv_vars.

Referenced by plot_drawPoint2D().

Here is the call graph for this function:

HIDDEN int plot_drawLine3D ( dm dmp,
point_t  pt1,
point_t  pt2 
)

Definition at line 378 of file dm-plot.c.

References draw_Line3D().

Here is the call graph for this function:

HIDDEN int plot_drawLines3D ( dm dmp,
int  npoints,
point_t *  points,
int  sflag 
)

Definition at line 385 of file dm-plot.c.

HIDDEN int plot_drawPoint2D ( dm dmp,
fastf_t  x,
fastf_t  y 
)

Definition at line 395 of file dm-plot.c.

References plot_drawLine2D().

Here is the call graph for this function:

HIDDEN int plot_setFGColor ( dm dmp,
unsigned char  r,
unsigned char  g,
unsigned char  b,
int  strict,
fastf_t  transparency 
)

Definition at line 402 of file dm-plot.c.

References bu_log(), dm_internal::dm_vars, pl_color(), and dm_vars::priv_vars.

Here is the call graph for this function:

HIDDEN int plot_setBGColor ( dm dmp,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Definition at line 413 of file dm-plot.c.

References bu_log().

Here is the call graph for this function:

HIDDEN int plot_setLineAttr ( dm dmp,
int  width,
int  style 
)

Definition at line 425 of file dm-plot.c.

References DM_DASHED_LINE, dm_internal::dm_lineStyle, dm_internal::dm_lineWidth, dm_internal::dm_vars, pl_linmod(), dm_vars::priv_vars, and OSL::Strings::width.

Here is the call graph for this function:

HIDDEN int plot_debug ( dm dmp,
int  lvl 
)
HIDDEN int plot_logfile ( dm dmp,
const char *  filename 
)

Definition at line 457 of file dm-plot.c.

References bu_vls_sprintf(), dm_internal::dm_interp, dm_internal::dm_log, dm_internal::dm_vars, and dm_vars::priv_vars.

Here is the call graph for this function:

HIDDEN int plot_setWinBounds ( dm dmp,
fastf_t w 
)
dm* plot_open ( Tcl_Interp *  interp,
int  argc,
const char *  argv[] 
)

Definition at line 584 of file dm-plot.c.

References BU_ALLOC, bu_vls_addr(), bu_vls_init(), bu_vls_printf(), bu_vls_strcat(), bu_vls_strcpy(), dm_internal::dm_interp, DM_NULL, dm_internal::dm_pathName, dm_plot, dm_internal::dm_tkName, dm_internal::dm_vars, dm_internal::dm_zclip, OSL::Strings::interp, pl_3space(), pl_space(), plot_close(), and dm_vars::priv_vars.

Referenced by dm_open().

Here is the call graph for this function: