nmg_plot.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include "machine.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
#include "nurb.h"
#include "plot3.h"

Include dependency graph for nmg_plot.c:

Go to the source code of this file.

Defines

#define US_DELAY   10
#define LEE_DIVIDE_TOL   (1.0e-5)
#define PICK_BROKEN_COLOR(p)

Functions

void nmg_vu_to_vlist (struct bu_list *vhead, const struct vertexuse *vu)
void nmg_eu_to_vlist (struct bu_list *vhead, const struct bu_list *eu_hd)
void nmg_lu_to_vlist (struct bu_list *vhead, const struct loopuse *lu, int poly_markers, const vectp_t normal)
void nmg_snurb_fu_to_vlist (struct bu_list *vhead, const struct faceuse *fu, int poly_markers)
void nmg_s_to_vlist (struct bu_list *vhead, const struct shell *s, int poly_markers)
void nmg_r_to_vlist (struct bu_list *vhead, const struct nmgregion *r, int poly_markers)
void nmg_m_to_vlist (struct bu_list *vhead, struct model *m, int poly_markers)
void nmg_offset_eu_vert (fastf_t *base, const struct edgeuse *eu, const fastf_t *face_normal, int tip)
void nmg_pl_v (FILE *fp, const struct vertex *v, long int *b)
void nmg_pl_e (FILE *fp, const struct edge *e, long int *b, int red, int green, int blue)
void nmg_pl_eu (FILE *fp, const struct edgeuse *eu, long int *b, int red, int green, int blue)
void nmg_pl_lu (FILE *fp, const struct loopuse *lu, long int *b, int red, int green, int blue)
void nmg_pl_fu (FILE *fp, const struct faceuse *fu, long int *b, int red, int green, int blue)
void nmg_pl_s (FILE *fp, const struct shell *s)
void nmg_pl_shell (FILE *fp, const struct shell *s, int fancy)
void nmg_pl_r (FILE *fp, const struct nmgregion *r)
void nmg_pl_m (FILE *fp, const struct model *m)
void nmg_vlblock_v (struct bn_vlblock *vbp, const struct vertex *v, long int *tab)
void nmg_vlblock_e (struct bn_vlblock *vbp, const struct edge *e, long int *tab, int red, int green, int blue, int fancy)
void nmg_vlblock_eu (struct bn_vlblock *vbp, const struct edgeuse *eu, long int *tab, int red, int green, int blue, int fancy, int loopnum)
void nmg_vlblock_euleft (struct bu_list *vh, const struct edgeuse *eu, const fastf_t *center, const fastf_t *mat, const fastf_t *xvec, const fastf_t *yvec, double len, const struct bn_tol *tol)
void nmg_vlblock_around_eu (struct bn_vlblock *vbp, const struct edgeuse *arg_eu, long int *tab, int fancy, const struct bn_tol *tol)
void nmg_vlblock_lu (struct bn_vlblock *vbp, const struct loopuse *lu, long int *tab, int red, int green, int blue, int fancy, int loopnum)
void nmg_vlblock_fu (struct bn_vlblock *vbp, const struct faceuse *fu, long int *tab, int fancy)
void nmg_vlblock_s (struct bn_vlblock *vbp, const struct shell *s, int fancy)
void nmg_vlblock_r (struct bn_vlblock *vbp, const struct nmgregion *r, int fancy)
void nmg_vlblock_m (struct bn_vlblock *vbp, const struct model *m, int fancy)
void nmg_pl_edges_in_2_shells (struct bn_vlblock *vbp, long int *b, const struct edgeuse *eu, int fancy, const struct bn_tol *tol)
void nmg_pl_isect (const char *filename, const struct shell *s, const struct bn_tol *tol)
void nmg_pl_comb_fu (int num1, int num2, const struct faceuse *fu1)
void nmg_pl_2fu (const char *str, int unused, const struct faceuse *fu1, const struct faceuse *fu2, int show_mates)
void nmg_plot_sigstepalong (int i)
void nmg_show_broken_classifier_stuff (long int *p, long int **classlist, int all_new, int fancy, const char *a_string)
void nmg_face_plot (const struct faceuse *fu)
void nmg_2face_plot (const struct faceuse *fu1, const struct faceuse *fu2)
void nmg_face_lu_plot (const struct loopuse *lu, const struct vertexuse *vu1, const struct vertexuse *vu2)
void nmg_plot_lu_ray (const struct loopuse *lu, const struct vertexuse *vu1, const struct vertexuse *vu2, const fastf_t *left)
void nmg_plot_ray_face (const char *fname, fastf_t *pt, const fastf_t *dir, const struct faceuse *fu)
void nmg_plot_lu_around_eu (const char *prefix, const struct edgeuse *eu, const struct bn_tol *tol)
int nmg_snurb_to_vlist (struct bu_list *vhead, const struct face_g_snurb *fg, int n_interior)
void nmg_cnurb_to_vlist (struct bu_list *vhead, const struct edgeuse *eu, int n_interior, int cmd)

Variables

void(* nmg_plot_anim_upcall )()
void(* nmg_vlblock_anim_upcall )()
void(* nmg_mged_debug_display_hack )()
double nmg_eue_dist = 0.05
int nmg_class_nothing_broken = 1


Detailed Description

This file contains routines that create VLISTs and UNIX-plot files. Some routines are essential to the MGED interface, some are more for diagnostic and visualization purposes.

There are several distinct families - nmg_ENTITY_to_vlist Wireframes & polgyons. For MGED "ev". nmg_pl_ENTITY Fancy edgeuse drawing, to plot file. nmg_vlblock_ENTITY Fancy edgeuse drawing, into vlblocks. show_broken_ENTITY Graphical display of classifier results. ...as well as assorted wrappers for debugging use.

In the interest of having only a single way of creating the fancy drawings, the code is migrating to creating everything first as VLBLOCKS, and converting that to UNIX-plot files or other formats as appropriate.

Authors - Lee A. Butler Michael John Muuss

Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5068 USA

Definition in file nmg_plot.c.


Define Documentation

#define US_DELAY   10
 

Definition at line 72 of file nmg_plot.c.

Referenced by nmg_pl_2fu(), and nmg_pl_comb_fu().

#define LEE_DIVIDE_TOL   (1.0e-5)
 

Definition at line 461 of file nmg_plot.c.

#define PICK_BROKEN_COLOR  ) 
 

Value:

{ \
        if (global_classlist == (long **)NULL) { \
                broken_color = 5; \
        } else if( NMG_INDEX_TEST(global_classlist[NMG_CLASS_AinB], (p)) ) \
                broken_color = NMG_CLASS_AinB; \
        else if( NMG_INDEX_TEST(global_classlist[NMG_CLASS_AonBshared], (p)) ) \
                broken_color = NMG_CLASS_AonBshared; \
        else if( NMG_INDEX_TEST(global_classlist[NMG_CLASS_AonBanti], (p)) ) \
                broken_color = NMG_CLASS_AonBanti; \
        else if ( NMG_INDEX_TEST(global_classlist[NMG_CLASS_AoutB], (p)) ) \
                broken_color = NMG_CLASS_AoutB; \
        else \
                broken_color = 4;}

Definition at line 1563 of file nmg_plot.c.


Function Documentation

void nmg_offset_eu_vert fastf_t base,
const struct edgeuse eu,
const fastf_t face_normal,
int  tip
 

N M G _ O F F S E T _ E U _ V E R T

Given an edgeuse, find an offset for its vertexuse which will place it "above" and "inside" the area of the face.

The point will be offset inwards along the edge slightly, to avoid obscuring the vertex, and will be offset off the face (in the direction of the face normal) slightly, to avoid obscuring the edge itself.

Definition at line 477 of file nmg_plot.c.

References BU_LIST_PPREV_CIRC, bzero, vertex_g::coord, edgeuse::eumate_p, MAGSQ, NMG_CK_EDGEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, nmg_eue_dist, vertexuse::v_p, VADD2, VCROSS, VDIVIDE_TOL, vertex::vg_p, VJOIN2, VSUB2, edgeuse::vu_p, and VUNITIZE.

void nmg_pl_v FILE *  fp,
const struct vertex v,
long int *  b
 

N M G _ P L _ V

Definition at line 672 of file nmg_plot.c.

References vertex_g::coord, DEBUG_LABEL_PTS, vertex::index, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_INDEX_RETURN_IF_SET_ELSE_SET, pdv_3move(), pdv_3point(), pl_color(), pl_label(), vertex::vg_p, and void().

Here is the call graph for this function:

void nmg_pl_e FILE *  fp,
const struct edge e,
long int *  b,
int  red,
int  green,
int  blue
 

N M G _ P L _ E

Definition at line 696 of file nmg_plot.c.

References vertex_g::coord, edge::eu_p, edgeuse::eumate_p, edge::index, NMG_CK_EDGEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_INDEX_RETURN_IF_SET_ELSE_SET, nmg_pl_v(), pdv_3line(), pl_color(), vertexuse::v_p, VADD2, vertex::vg_p, VSUB2, VSUB2SCALE, and edgeuse::vu_p.

Here is the call graph for this function:

void nmg_pl_eu FILE *  fp,
const struct edgeuse eu,
long int *  b,
int  red,
int  green,
int  blue
 

M N G _ P L _ E U

Definition at line 734 of file nmg_plot.c.

References edgeuse::e_p, edgeuse::eumate_p, edgeuse::index, edgeuse::lu_p, loopuse::magic_p, edgeuse::magic_p, NMG_CK_EDGE, NMG_CK_EDGEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_FACEUSE_MAGIC, NMG_INDEX_RETURN_IF_SET_ELSE_SET, NMG_LOOPUSE_MAGIC, nmg_pl_e(), OT_OPPOSITE, OT_SAME, pdv_3line(), pl_color(), loopuse::up, edgeuse::up, vertexuse::v_p, vertex::vg_p, and edgeuse::vu_p.

Here is the call graph for this function:

void nmg_pl_lu FILE *  fp,
const struct loopuse lu,
long int *  b,
int  red,
int  green,
int  blue
 

N M G _ P L _ L U

Definition at line 788 of file nmg_plot.c.

References nmg_vlblock_lu(), rt_plot_vlblock(), rt_vlblock_free(), and rt_vlblock_init().

Here is the call graph for this function:

void nmg_pl_fu FILE *  fp,
const struct faceuse fu,
long int *  b,
int  red,
int  green,
int  blue
 

M N G _ P L _ F U

Definition at line 802 of file nmg_plot.c.

References BU_LIST_FOR, faceuse::index, faceuse::lu_hd, NMG_CK_FACEUSE, NMG_INDEX_RETURN_IF_SET_ELSE_SET, nmg_vlblock_lu(), rt_plot_vlblock(), rt_vlblock_free(), and rt_vlblock_init().

Here is the call graph for this function:

void nmg_vlblock_v struct bn_vlblock vbp,
const struct vertex v,
long int *  tab
 

N M G _ V L B L O C K _ V

Definition at line 889 of file nmg_plot.c.

References BN_CK_VLBLOCK, bn_vlist_3string(), BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, vertex_g::coord, DEBUG_LABEL_PTS, bn_vlblock::free_vlist_hd, vertex::index, MAT_IDN, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_INDEX_RETURN_IF_SET_ELSE_SET, RT_ADD_VLIST, rt_vlblock_find(), vertex::vg_p, and void().

Here is the call graph for this function:

void nmg_vlblock_e struct bn_vlblock vbp,
const struct edge e,
long int *  tab,
int  red,
int  green,
int  blue,
int  fancy
 

N M G _ V L B L O C K _ E

Definition at line 920 of file nmg_plot.c.

References BN_CK_VLBLOCK, BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, vertex_g::coord, edge::eu_p, edgeuse::eumate_p, edge::index, NMG_CK_EDGE, NMG_CK_EDGEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_INDEX_RETURN_IF_SET_ELSE_SET, nmg_vlblock_v(), RT_ADD_VLIST, rt_vlblock_find(), vertexuse::v_p, VADD2, vertex::vg_p, VSUB2, VSUB2SCALE, and edgeuse::vu_p.

Here is the call graph for this function:

void nmg_vlblock_eu struct bn_vlblock vbp,
const struct edgeuse eu,
long int *  tab,
int  red,
int  green,
int  blue,
int  fancy,
int  loopnum
 

M N G _ V L B L O C K _ E U

Definition at line 962 of file nmg_plot.c.

References BN_CK_VLBLOCK, BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, edgeuse::e_p, edgeuse::eumate_p, loopuse::fu_p, edgeuse::index, edgeuse::lu_p, loopuse::magic_p, edgeuse::magic_p, NMG_CK_EDGE, NMG_CK_EDGEUSE, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_FACEUSE_MAGIC, NMG_INDEX_RETURN_IF_SET_ELSE_SET, NMG_LOOPUSE_MAGIC, nmg_vlblock_e(), loopuse::orientation, faceuse::orientation, OT_OPPOSITE, OT_SAME, RT_ADD_VLIST, rt_vlblock_find(), loopuse::up, edgeuse::up, vertexuse::v_p, vertex::vg_p, and edgeuse::vu_p.

Here is the call graph for this function:

void nmg_vlblock_euleft struct bu_list vh,
const struct edgeuse eu,
const fastf_t center,
const fastf_t mat,
const fastf_t xvec,
const fastf_t yvec,
double  len,
const struct bn_tol tol
 

N M G _ V L B L O C K _ E U L E F T

Draw the left vector for this edgeuse. At the tip, write the angle around the edgeuse, in degrees.

Color is determined by caller.

Definition at line 1083 of file nmg_plot.c.

References bn_angle_measure(), BN_CK_TOL, bn_radtodeg, bn_vlist_3string(), BN_VLIST_LINE_DRAW, BN_VLIST_LINE_MOVE, NMG_CK_EDGEUSE, nmg_find_eu_leftvec(), RT_ADD_VLIST, and VJOIN1.

Here is the call graph for this function:

void nmg_vlblock_around_eu struct bn_vlblock vbp,
const struct edgeuse arg_eu,
long int *  tab,
int  fancy,
const struct bn_tol tol
 

N M G _ V L B L O C K _ A R O U N D _ E U

Given an edgeuse, plot all the edgeuses around the common edge. A graphical parallel to nmg_pr_fu_around_eu_vecs().

If the "fancy" flag is set, draw an angle fan around the edge midpoint, using the same angular reference as nmg_pr_fu_around_eu_vecs(), so that the printed output can be cross-referenced to this display.

Definition at line 1123 of file nmg_plot.c.

References BN_CK_TOL, BN_CK_VLBLOCK, vertex_g::coord, edgeuse::eumate_p, MAGNITUDE, MAT_ZERO, NMG_CK_EDGEUSE, nmg_eu_2vecs_perp(), nmg_vlblock_eu(), nmg_vlblock_euleft(), NULL, edgeuse::radial_p, rt_vlblock_find(), vertexuse::v_p, VADD2SCALE, vertex::vg_p, VSUB2, edgeuse::vu_p, X, Y, and Z.

Here is the call graph for this function:

void nmg_vlblock_lu struct bn_vlblock vbp,
const struct loopuse lu,
long int *  tab,
int  red,
int  green,
int  blue,
int  fancy,
int  loopnum
 

N M G _ V L B L O C K _ L U

Definition at line 1190 of file nmg_plot.c.

References BN_CK_VLBLOCK, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_PNEXT, loopuse::down_hd, loopuse::index, NMG_CK_LOOPUSE, NMG_CK_VERTEXUSE, NMG_EDGEUSE_MAGIC, NMG_INDEX_RETURN_IF_SET_ELSE_SET, NMG_VERTEXUSE_MAGIC, nmg_vlblock_eu(), nmg_vlblock_v(), loopuse::orientation, OT_BOOLPLACE, and vertexuse::v_p.

Here is the call graph for this function:

void nmg_vlblock_fu struct bn_vlblock vbp,
const struct faceuse fu,
long int *  tab,
int  fancy
 

M N G _ V L B L O C K _ F U

Definition at line 1218 of file nmg_plot.c.

References BN_CK_VLBLOCK, BU_LIST_FOR, faceuse::index, faceuse::lu_hd, NMG_CK_FACEUSE, NMG_INDEX_RETURN_IF_SET_ELSE_SET, and nmg_vlblock_lu().

Here is the call graph for this function:

void nmg_pl_edges_in_2_shells struct bn_vlblock vbp,
long int *  b,
const struct edgeuse eu,
int  fancy,
const struct bn_tol tol
 

Definition at line 1336 of file nmg_plot.c.

References BN_CK_TOL, edgeuse::eumate_p, loopuse::fu_p, edgeuse::lu_p, loopuse::magic_p, edgeuse::magic_p, NMG_CK_EDGEUSE, NMG_CK_FACEUSE, NMG_CK_LOOPUSE, NMG_CK_SHELL, NMG_FACEUSE_MAGIC, NMG_LOOPUSE_MAGIC, nmg_vlblock_around_eu(), edgeuse::radial_p, faceuse::s_p, loopuse::up, and edgeuse::up.

Here is the call graph for this function:

void nmg_plot_sigstepalong int  i  ) 
 

Definition at line 1832 of file nmg_plot.c.

Referenced by nmg_show_broken_classifier_stuff().

void nmg_show_broken_classifier_stuff long int *  p,
long int **  classlist,
int  all_new,
int  fancy,
const char *  a_string
 

S H O W _ B R O K E N _ S T U F F

XXX Needs new name, with nmg_ prefix, and a stronger indication that this is a graphical display of classifier operation.

Definition at line 1844 of file nmg_plot.c.

References bu_calloc(), BU_LIST_FOR, bu_log(), bzero, faceuse::lu_hd, model::maxindex, NMG_FACE_MAGIC, NMG_FACEUSE_MAGIC, nmg_find_model(), NMG_MODEL_MAGIC, nmg_plot_sigstepalong(), NMG_REGION_MAGIC, NMG_SHELL_MAGIC, nmg_show_broken_classifier_stuff(), NULL, rt_realloc, rt_vlblock_free(), rt_vlblock_init(), and void().

Here is the call graph for this function:

void nmg_plot_lu_ray const struct loopuse lu,
const struct vertexuse vu1,
const struct vertexuse vu2,
const fastf_t left
 

N M G _ P L O T _ L U _ R A Y

Plot the loop, a ray from vu1 to vu2, and the left vector.

Definition at line 2138 of file nmg_plot.c.

References bu_calloc(), bu_free(), bu_log(), vertex_g::coord, DEBUG_PLOTEM, MAGNITUDE, model::maxindex, NMG_CK_LOOPUSE, NMG_CK_VERTEXUSE, nmg_find_model(), nmg_pl_lu(), NULL, pdv_3line(), perror(), pl_color(), vertexuse::v_p, vertex::vg_p, VJOIN1, and VSUB2.

Here is the call graph for this function:

void nmg_plot_ray_face const char *  fname,
fastf_t pt,
const fastf_t dir,
const struct faceuse fu
 

N M G _ P L O T _ R A Y _ F A C E

Definition at line 2191 of file nmg_plot.c.

References bu_calloc(), bu_free(), bu_log(), DEBUG_NMGRT, nmgregion::m_p, model::maxindex, name, nmg_pl_fu(), NULL, pdv_3line(), perror(), shell::r_p, rt_bomb(), faceuse::s_p, VADD2, void(), and VSCALE.

Here is the call graph for this function:


Variable Documentation

int nmg_class_nothing_broken = 1
 

Definition at line 1550 of file nmg_plot.c.


Generated on Mon Sep 18 01:25:08 2006 for BRL-CAD by  doxygen 1.4.6