BRL-CAD
#include "common.h"
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
#include "nurb.h"
Include dependency graph for nmg_pr.c:

Go to the source code of this file.

Macros

#define MKPAD(_h)
 
#define Return   { h[strlen(h)-3] = '\0'; return; }
 

Functions

char * nmg_orientation (int orientation)
 
void nmg_pr_orient (int orientation, const char *h)
 
void nmg_pr_m (const struct model *m)
 
void nmg_pr_r (const struct nmgregion *r, char *h)
 
void nmg_pr_sa (const struct shell_a *sa, char *h)
 
void nmg_pr_lg (const struct loop_g *lg, char *h)
 
void nmg_pr_fg (const uint32_t *magic, char *h)
 
void nmg_pr_s (const struct shell *s, char *h)
 
void nmg_pr_s_briefly (const struct shell *s, char *h)
 
void nmg_pr_f (const struct face *f, char *h)
 
void nmg_pr_fu (const struct faceuse *fu, char *h)
 
void nmg_pr_fu_briefly (const struct faceuse *fu, char *h)
 
void nmg_pr_l (const struct loop *l, char *h)
 
void nmg_pr_lu (const struct loopuse *lu, char *h)
 
void nmg_pr_lu_briefly (const struct loopuse *lu, char *h)
 
void nmg_pr_eg (const uint32_t *eg_magic_p, char *h)
 
void nmg_pr_e (const struct edge *e, char *h)
 
void nmg_pr_eu (const struct edgeuse *eu, char *h)
 
void nmg_pr_eu_briefly (const struct edgeuse *eu, char *h)
 
void nmg_pr_eu_endpoints (const struct edgeuse *eu, char *h)
 
void nmg_pr_vg (const struct vertex_g *vg, char *h)
 
void nmg_pr_v (const struct vertex *v, char *h)
 
void nmg_pr_vu (const struct vertexuse *vu, char *h)
 
void nmg_pr_vu_briefly (const struct vertexuse *vu, char *h)
 
void nmg_pr_vua (const uint32_t *magic_p, char *h)
 
void nmg_euprint (const char *str, const struct edgeuse *eu)
 
void nmg_pr_ptbl (const char *title, const struct bu_ptbl *tbl, int verbose)
 
void nmg_pr_ptbl_vert_list (const char *str, const struct bu_ptbl *tbl, const fastf_t *mag)
 
void nmg_pr_one_eu_vecs (const struct edgeuse *eu, const fastf_t *xvec, const fastf_t *yvec, const fastf_t *zvec, const struct bn_tol *tol)
 
void nmg_pr_fu_around_eu_vecs (const struct edgeuse *eu, const fastf_t *xvec, const fastf_t *yvec, const fastf_t *zvec, const struct bn_tol *tol)
 
void nmg_pr_fu_around_eu (const struct edgeuse *eu, const struct bn_tol *tol)
 
void nmg_pl_lu_around_eu (const struct edgeuse *eu)
 
void nmg_pr_fus_in_fg (const uint32_t *fg_magic)
 

Detailed Description

Contains routines to print or describe NMG data structures. These routines are always available (not conditionally compiled) so that NMG programmers can always format and print their data structures.

Definition in file nmg_pr.c.

Macro Definition Documentation

#define MKPAD (   _h)
Value:
{ \
if (!_h) { _h = nmg_pr_padstr; nmg_pr_padstr[0] = '\0'; } \
else if ((_h) < nmg_pr_padstr || (_h) >= nmg_pr_padstr+sizeof(nmg_pr_padstr)) { \
bu_strlcpy(nmg_pr_padstr, (_h), sizeof(nmg_pr_padstr)/2); \
_h = nmg_pr_padstr; \
} else { if (strlen(_h) < sizeof(nmg_pr_padstr)-4) bu_strlcat(_h, " ", sizeof(nmg_pr_padstr)); } }
if(share_geom)
Definition: nmg_mod.c:3829
#define bu_strlcpy(dst, src, size)
Definition: str.h:60
else
Definition: nmg_mod.c:3872
#define bu_strlcat(dst, src, size)
Definition: str.h:50

NOTE: All the nmg_pr_*() routines take an "h" (header string) pointer. This can be an arbitrary caller-provided string, as long as it is kept short. The string will be copied over into nmg_pr_padstr[], and "h" will be changed to point there, so spaces can be added to the end.

Definition at line 109 of file nmg_pr.c.

Referenced by nmg_pr_e(), nmg_pr_eg(), nmg_pr_eu(), nmg_pr_eu_briefly(), nmg_pr_eu_endpoints(), nmg_pr_f(), nmg_pr_fg(), nmg_pr_fu(), nmg_pr_fu_briefly(), nmg_pr_l(), nmg_pr_lg(), nmg_pr_lu(), nmg_pr_lu_briefly(), nmg_pr_r(), nmg_pr_s(), nmg_pr_s_briefly(), nmg_pr_sa(), nmg_pr_v(), nmg_pr_vg(), nmg_pr_vu(), nmg_pr_vu_briefly(), and nmg_pr_vua().

Function Documentation

void nmg_pr_orient ( int  orientation,
const char *  h 
)

Print the orientation in a nice, English form

Definition at line 72 of file nmg_pr.c.

References bu_log().

Referenced by nmg_pr_eu(), nmg_pr_fu(), and nmg_pr_lu().

Here is the call graph for this function:

void nmg_pr_m ( const struct model *  m)

Definition at line 86 of file nmg_pr.c.

References BU_LIST_FOR, bu_log(), NMG_MODEL_MAGIC, and nmg_pr_r().

Referenced by rt_nmg_print().

Here is the call graph for this function:

void nmg_pr_r ( const struct nmgregion *  r,
char *  h 
)

Definition at line 119 of file nmg_pr.c.

References BU_LIST_FOR, bu_log(), MKPAD, nmg_pr_s(), NMG_REGION_MAGIC, Return, and s.

Referenced by nmg_pr_m().

Here is the call graph for this function:

void nmg_pr_sa ( const struct shell_a *  sa,
char *  h 
)

Definition at line 145 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_SHELL_A_MAGIC, Return, X, Y, and Z.

Referenced by nmg_pr_s().

Here is the call graph for this function:

void nmg_pr_lg ( const struct loop_g *  lg,
char *  h 
)

Definition at line 165 of file nmg_pr.c.

References bu_log(), MKPAD, Return, X, Y, and Z.

Referenced by nmg_pr_l().

Here is the call graph for this function:

void nmg_pr_fg ( const uint32_t *  magic,
char *  h 
)

Definition at line 181 of file nmg_pr.c.

References bu_bomb(), bu_log(), MKPAD, N, NMG_FACE_G_PLANE_MAGIC, NMG_FACE_G_SNURB_MAGIC, and Return.

Referenced by nmg_pr_f().

Here is the call graph for this function:

void nmg_pr_s ( const struct shell *  s,
char *  h 
)

Definition at line 230 of file nmg_pr.c.

References BU_LIST_FOR, bu_log(), lu, MKPAD, nmg_pr_eu(), nmg_pr_fu(), nmg_pr_lu(), nmg_pr_sa(), nmg_pr_vu(), NMG_SHELL_MAGIC, and Return.

Referenced by nmg_ml(), and nmg_pr_r().

Here is the call graph for this function:

void nmg_pr_s_briefly ( const struct shell *  s,
char *  h 
)

Definition at line 270 of file nmg_pr.c.

References BU_LIST_FOR, bu_log(), lu, MKPAD, nmg_pr_eu_briefly(), nmg_pr_fu_briefly(), nmg_pr_lu_briefly(), nmg_pr_vu_briefly(), NMG_SHELL_MAGIC, and Return.

Referenced by nmg_booltree_evaluate().

Here is the call graph for this function:

void nmg_pr_f ( const struct face *  f,
char *  h 
)

Definition at line 303 of file nmg_pr.c.

References bu_log(), MKPAD, nmg_pr_fg(), Return, X, Y, and Z.

Referenced by nmg_pr_fu().

Here is the call graph for this function:

void nmg_pr_fu ( const struct faceuse *  fu,
char *  h 
)

Definition at line 327 of file nmg_pr.c.

References BU_LIST_FOR, bu_log(), lu, MKPAD, NMG_FACEUSE_MAGIC, nmg_pr_f(), nmg_pr_lu(), nmg_pr_orient(), and Return.

Referenced by nmg_eval_shell(), and nmg_pr_s().

Here is the call graph for this function:

void nmg_pr_fu_briefly ( const struct faceuse *  fu,
char *  h 
)
void nmg_pr_l ( const struct loop *  l,
char *  h 
)

Definition at line 385 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_LOOP_MAGIC, nmg_pr_lg(), and Return.

Referenced by nmg_pr_lu().

Here is the call graph for this function:

void nmg_pr_lu ( const struct loopuse *  lu,
char *  h 
)

Definition at line 405 of file nmg_pr.c.

References BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_PNEXT, bu_log(), MKPAD, NMG_CK_LOOPUSE(), NMG_EDGEUSE_MAGIC, NMG_FACEUSE_MAGIC, nmg_pr_eu(), nmg_pr_l(), nmg_pr_orient(), nmg_pr_vu(), NMG_SHELL_MAGIC, NMG_VERTEXUSE_MAGIC, and Return.

Referenced by cut_unimonotone(), nmg_ck_lueu(), nmg_face_state_transition(), nmg_pr_fu(), and nmg_pr_s().

Here is the call graph for this function:

void nmg_pr_lu_briefly ( const struct loopuse *  lu,
char *  h 
)
void nmg_pr_eg ( const uint32_t *  eg_magic_p,
char *  h 
)

Expects a pointer to the magic number of an edge geometry structure either edge_g_lseg or edge_g_cnurb structures.

Definition at line 488 of file nmg_pr.c.

References bu_list_len(), bu_log(), MKPAD, NMG_EDGE_G_CNURB_MAGIC, NMG_EDGE_G_LSEG_MAGIC, Return, and V3ARGS.

Referenced by nmg_find_edge_between_2fu(), nmg_find_eg_between_2fg(), nmg_isect_line2_face2pNEW(), nmg_pr_eu(), nmg_repair_v_near_v(), and nmg_search_v_eg().

Here is the call graph for this function:

void nmg_pr_e ( const struct edge *  e,
char *  h 
)

Definition at line 535 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_EDGE_MAGIC, and Return.

Referenced by nmg_pr_eu().

Here is the call graph for this function:

void nmg_pr_eu ( const struct edgeuse *  eu,
char *  h 
)

Definition at line 552 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_LOOPUSE_MAGIC, nmg_pr_e(), nmg_pr_eg(), nmg_pr_orient(), nmg_pr_vu(), NMG_SHELL_MAGIC, and Return.

Referenced by nmg_assess_eu(), nmg_pr_lu(), nmg_pr_s(), and nmg_search_v_eg().

Here is the call graph for this function:

void nmg_pr_eu_briefly ( const struct edgeuse *  eu,
char *  h 
)

Definition at line 586 of file nmg_pr.c.

References bu_log(), MKPAD, nmg_pr_vu_briefly(), and Return.

Referenced by nmg_face_rs_init(), nmg_find_eg_between_2fg(), nmg_k0eu(), nmg_pr_lu_briefly(), and nmg_pr_s_briefly().

Here is the call graph for this function:

void nmg_pr_eu_endpoints ( const struct edgeuse *  eu,
char *  h 
)

Definition at line 600 of file nmg_pr.c.

References bu_log(), MKPAD, Return, and V3ARGS.

Referenced by nmg_face_state_transition(), nmg_find_edge_between_2fu(), and nmg_find_eg_between_2fg().

Here is the call graph for this function:

void nmg_pr_vg ( const struct vertex_g *  vg,
char *  h 
)

Definition at line 622 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_VERTEX_G_MAGIC, Return, and V3ARGS.

Referenced by nmg_pr_v().

Here is the call graph for this function:

void nmg_pr_v ( const struct vertex *  v,
char *  h 
)

Definition at line 639 of file nmg_pr.c.

References bu_log(), MKPAD, nmg_pr_vg(), NMG_VERTEX_MAGIC, and Return.

Referenced by nmg_pr_vu(), and nmg_region_v_unique().

Here is the call graph for this function:

void nmg_pr_vu ( const struct vertexuse *  vu,
char *  h 
)

Definition at line 664 of file nmg_pr.c.

References bu_log(), MKPAD, NMG_EDGEUSE_MAGIC, NMG_LOOPUSE_MAGIC, nmg_pr_v(), nmg_pr_vua(), NMG_SHELL_MAGIC, NMG_VERTEXUSE_A_CNURB_MAGIC, NMG_VERTEXUSE_A_PLANE_MAGIC, NMG_VERTEXUSE_MAGIC, Return, and V3ARGS.

Referenced by nmg_pr_eu(), nmg_pr_lu(), and nmg_pr_s().

Here is the call graph for this function:

void nmg_pr_vu_briefly ( const struct vertexuse *  vu,
char *  h 
)

Definition at line 702 of file nmg_pr.c.

References bu_log(), MKPAD, Return, and V3ARGS.

Referenced by nmg_assess_eu(), nmg_face_cutjoin(), nmg_face_rs_init(), nmg_face_state_transition(), nmg_pr_eu_briefly(), nmg_pr_lu_briefly(), nmg_pr_s_briefly(), and nmg_purge_unwanted_intersection_points().

Here is the call graph for this function:

void nmg_pr_vua ( const uint32_t *  magic_p,
char *  h 
)

Definition at line 725 of file nmg_pr.c.

References bu_log(), MKPAD, N, NMG_VERTEXUSE_A_CNURB_MAGIC, NMG_VERTEXUSE_A_PLANE_MAGIC, Return, and V3ARGS.

Referenced by nmg_pr_vu().

Here is the call graph for this function:

void nmg_euprint ( const char *  str,
const struct edgeuse *  eu 
)

Definition at line 751 of file nmg_pr.c.

References bu_log().

Referenced by nmg_radial_join_eu(), and nmg_radial_join_eu_NEW().

Here is the call graph for this function:

void nmg_pr_ptbl ( const char *  title,
const struct bu_ptbl tbl,
int  verbose 
)

Print an bu_ptbl array for inspection.

Definition at line 776 of file nmg_pr.c.

References BU_CK_PTBL, bu_identify_magic(), BU_LIST_PNEXT_CIRC, bu_log(), BU_PTBL_BASEADDR, BU_PTBL_LASTADDR, bu_ptbl::end, NMG_EDGEUSE_MAGIC, and NMG_VERTEXUSE_MAGIC.

Referenced by nmg_ck_vu_ptbl(), and nmg_radial_join_eu_NEW().

Here is the call graph for this function:

void nmg_pr_ptbl_vert_list ( const char *  str,
const struct bu_ptbl tbl,
const fastf_t mag 
)

Print a ptbl array as a vertex list.

Definition at line 817 of file nmg_pr.c.

References bu_bomb(), bu_log(), bu_ptbl::buffer, bu_ptbl::end, NMG_EDGEUSE_MAGIC, NMG_LOOPUSE_MAGIC, NMG_VERTEXUSE_MAGIC, OSL::Strings::v, and V3ARGS.

Here is the call graph for this function:

void nmg_pr_one_eu_vecs ( const struct edgeuse *  eu,
const fastf_t xvec,
const fastf_t yvec,
const fastf_t zvec,
const struct bn_tol tol 
)

Common formatting code for edgeuses and edgeuse mates. Does not mind wire edges.

Definition at line 864 of file nmg_pr.c.

References bu_log(), lu, NMG_CK_LOOPUSE(), NMG_CK_SHELL(), NMG_FACE_G_SNURB_MAGIC, NMG_FACEUSE_MAGIC, NMG_LOOPUSE_MAGIC, nmg_measure_fu_angle(), nmg_orientation(), and s.

Referenced by nmg_pr_fu_around_eu_vecs().

Here is the call graph for this function:

void nmg_pr_fu_around_eu_vecs ( const struct edgeuse *  eu,
const fastf_t xvec,
const fastf_t yvec,
const fastf_t zvec,
const struct bn_tol tol 
)

Definition at line 918 of file nmg_pr.c.

References BN_CK_TOL, bu_log(), eu1, and nmg_pr_one_eu_vecs().

Referenced by nmg_do_radial_join(), nmg_pr_fu_around_eu(), nmg_radial_build_list(), nmg_radial_implement_decisions(), nmg_radial_join_eu(), nmg_radial_join_eu_NEW(), and nmg_s_radial_harmonize().

Here is the call graph for this function:

void nmg_pr_fu_around_eu ( const struct edgeuse *  eu,
const struct bn_tol tol 
)

A debugging routine to print all the faceuses around a given edge, starting with the given edgeuse. The normal of the first face is considered to be "0 degrees", and the rest are measured from there.

Definition at line 953 of file nmg_pr.c.

References BN_CK_TOL, bu_log(), NMG_EDGE_G_CNURB_MAGIC, nmg_eu_2vecs_perp(), nmg_pr_fu_around_eu_vecs(), and VSET.

Referenced by nmg_check_radial(), nmg_dangling_face(), nmg_eu_2s_orient_bad(), and nmg_find_eg_between_2fg().

Here is the call graph for this function:

void nmg_pl_lu_around_eu ( const struct edgeuse *  eu)

Plot all the loopuses around an edgeuse. Don't bother drawing the loopuse mates.

Definition at line 979 of file nmg_pr.c.

References bu_calloc(), bu_free(), bu_log(), eu1, nmg_find_model(), NMG_LOOPUSE_MAGIC, and nmg_pl_lu().

Referenced by nmg_find_eg_between_2fg().

Here is the call graph for this function:

void nmg_pr_fus_in_fg ( const uint32_t *  fg_magic)

For either kind of face geometry, print the list of all faces & faceuses that share this geometry.

Definition at line 1031 of file nmg_pr.c.

References BU_LIST_FOR, and bu_log().

Referenced by nmg_find_eg_between_2fg().

Here is the call graph for this function: