BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <math.h>
#include "bio.h"
#include "vmath.h"
#include "nmg.h"
#include "raytrace.h"
Include dependency graph for nmg_eval.c:

Go to the source code of this file.

Data Structures

struct  nmg_bool_state
 

Macros

#define BACTION_KILL   1
 
#define BACTION_RETAIN   2
 
#define BACTION_RETAIN_AND_FLIP   3
 
#define NMG_CLASS_BAD   8
 

Functions

HIDDEN void nmg_eval_shell (struct shell *s, struct nmg_bool_state *bs)
 
HIDDEN void nmg_eval_plot (struct nmg_bool_state *bs, int num)
 
void nmg_ck_lu_orientation (struct loopuse *lu, const struct bn_tol *tolp)
 
const char * nmg_class_name (int nmg_class)
 
void nmg_evaluate_boolean (struct shell *sA, struct shell *sB, int op, char **classlist, const struct bn_tol *tol)
 
HIDDEN int nmg_eval_action (uint32_t *ptr, register struct nmg_bool_state *bs)
 
HIDDEN void nmg_eval_shell (register struct shell *s, struct nmg_bool_state *bs)
 

Detailed Description

Evaluate boolean operations on NMG objects.

Definition in file nmg_eval.c.

Macro Definition Documentation

#define BACTION_KILL   1

Definition at line 55 of file nmg_eval.c.

Referenced by nmg_eval_shell().

#define BACTION_RETAIN   2

Definition at line 56 of file nmg_eval.c.

Referenced by nmg_eval_action(), and nmg_eval_shell().

#define BACTION_RETAIN_AND_FLIP   3

Definition at line 57 of file nmg_eval.c.

#define NMG_CLASS_BAD   8

Definition at line 68 of file nmg_eval.c.

Referenced by nmg_class_name(), and nmg_eval_action().

Function Documentation

HIDDEN void nmg_eval_shell ( struct shell *  s,
struct nmg_bool_state bs 
)

Referenced by nmg_evaluate_boolean().

HIDDEN void nmg_eval_plot ( struct nmg_bool_state bs,
int  num 
)

Called from nmg_eval_shell

Located here because definition of nmg_bool_state is local to this module.

Definition at line 594 of file nmg_eval.c.

References BN_CK_TOL, nmg_bool_state::bs_dest, nmg_bool_state::bs_src, nmg_bool_state::bs_tol, bu_log(), rt_g::NMG_debug, nmg_pl_s(), nmg_vlblock_anim_upcall, nmg_vlblock_s(), rt_vlblock_free(), rt_vlblock_init(), and RTG.

Referenced by nmg_eval_shell().

Here is the call graph for this function:

void nmg_ck_lu_orientation ( struct loopuse *  lu,
const struct bn_tol tolp 
)

Make sure that the lu and fu orientation flags are consistent with the geometric arrangement of the vertices and the faceuse normal.

Definition at line 87 of file nmg_eval.c.

References bu_bomb(), bu_log(), NEAR_ZERO, NMG_CK_LOOPUSE(), nmg_loop_plane_newell(), nmg_orientation(), and bn_tol::perp.

Referenced by nmg_eval_shell().

Here is the call graph for this function:

void nmg_evaluate_boolean ( struct shell *  sA,
struct shell *  sB,
int  op,
char **  classlist,
const struct bn_tol tol 
)

Evaluate a boolean operation on the two shells "A" and "B", of the form "answer = A op B". As input, each element (loop-in-face, wire loop, wire edge, vertex) in both A and B has been classified as being "in", "on", or "out" of the other shell. Using these classifications, operate on the input shells. At the end, shell A contains the resultant object, and shell B is destroyed.

Definition at line 189 of file nmg_eval.c.

References BN_CK_TOL, nmg_bool_state::bs_actions, nmg_bool_state::bs_classtab, nmg_bool_state::bs_dest, nmg_bool_state::bs_isA, nmg_bool_state::bs_src, nmg_bool_state::bs_tol, bu_bomb(), bu_log(), NMG_CK_SHELL(), rt_g::NMG_debug, nmg_eval_shell(), nmg_invert_shell(), nmg_js(), nmg_pl_s(), nmg_rm_redundancies(), and RTG.

Here is the call graph for this function:

HIDDEN int nmg_eval_action ( uint32_t *  ptr,
register struct nmg_bool_state bs 
)

Given a pointer to some NMG data structure, search the 4 classification lists to determine its classification. (XXX In the future, this should be done with one big array). Then, return the action code for an item of that classification.

Definition at line 269 of file nmg_eval.c.

References BACTION_RETAIN, BN_CK_TOL, nmg_bool_state::bs_actions, nmg_bool_state::bs_classtab, nmg_bool_state::bs_isA, nmg_bool_state::bs_tol, bu_identify_magic(), bu_log(), NMG_CLASS_BAD, nmg_class_name(), rt_g::NMG_debug, nmg_index_of_struct(), out, and RTG.

Referenced by nmg_eval_shell().

Here is the call graph for this function:

HIDDEN void nmg_eval_shell ( register struct shell *  s,
struct nmg_bool_state bs 
)

Make a life-and-death decision on every element of a shell. Descend the "great chain of being" from the face to loop to edge to vertex, saving or demoting along the way.

Note that there is no moving of items from one shell to another.

Definition at line 352 of file nmg_eval.c.

References BACTION_KILL, BACTION_RETAIN, BN_CK_TOL, nmg_bool_state::bs_tol, bu_bomb(), BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_IS_EMPTY, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, bu_log(), lu, NMG_CK_LOOPUSE(), nmg_ck_lu_orientation(), NMG_CK_SHELL(), rt_g::NMG_debug, nmg_demote_eu(), nmg_demote_lu(), nmg_eval_action(), nmg_eval_plot(), nmg_kfu(), nmg_klu(), nmg_kvu(), nmg_pr_fu(), NMG_VERTEXUSE_MAGIC, nmg_vshell(), and RTG.

Here is the call graph for this function: