93#define RT_DBTS_INIT_ZERO { RT_DBTS_MAGIC, NULL, 0, 0, 0, 0, 0, RT_MATER_INFO_INIT_ZERO, MAT_INIT_ZERO, 0, BU_AVS_INIT_ZERO, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
95#define RT_DBTS_INIT_IDN { RT_DBTS_MAGIC, NULL, 0, 0, 0, 0, 100, RT_MATER_INFO_INIT_IDN, MAT_INIT_IDN, 0, BU_AVS_INIT_ZERO, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
98#define RT_DBTS_INIT(_p) do { \
99 (_p)->magic = RT_DBTS_MAGIC; \
100 (_p)->ts_dbip = NULL; \
101 (_p)->ts_sofar = 0; \
102 (_p)->ts_regionid = 0; \
103 (_p)->ts_aircode = 0; \
104 (_p)->ts_gmater = 0; \
106 VSETALL((_p)->ts_mater.ma_color, 1.0); \
107 (_p)->ts_mater.ma_temperature = -1.0; \
108 (_p)->ts_mater.ma_color_valid = 0; \
109 (_p)->ts_mater.ma_cinherit = DB_INH_LOWER; \
110 (_p)->ts_mater.ma_minherit = DB_INH_LOWER; \
111 (_p)->ts_mater.ma_shader = NULL; \
112 MAT_IDN((_p)->ts_mat); \
113 (_p)->ts_is_fastgen = 0; \
114 BU_AVS_INIT(&(_p)->ts_attrs); \
115 (_p)->ts_stop_at_regions = 0; \
116 (_p)->ts_region_start_func = NULL; \
117 (_p)->ts_region_end_func = NULL; \
118 (_p)->ts_leaf_func = NULL; \
119 (_p)->ts_ttol = NULL; \
120 (_p)->ts_tol = NULL; \
122 (_p)->ts_rtip = NULL; \
125#define TS_SOFAR_MINUS 1
126#define TS_SOFAR_INTER 2
127#define TS_SOFAR_REGION 4
129#define RT_CK_DBTS(_p) BU_CKMAG(_p, RT_DBTS_MAGIC, "db_tree_state")
152#define RT_DB_TRAVERSE_INIT(_p) {(_p)->magic = RT_DB_TRAVERSE_MAGIC; \
153 (_p)->dbip = ((void *)0); (_p)->comb_enter_func = ((void *)0); \
154 (_p)->comb_exit_func = ((void *)0); (_p)->leaf_func = ((void *)0); \
155 (_p)->client_data = ((void *)0);}
156#define RT_CK_DB_TRAVERSE(_p) BU_CKMAG(_p, RT_DB_TRAVERSE_MAGIC, "db_traverse")
163#define RT_CK_CTS(_p) BU_CKMAG(_p, RT_CTS_MAGIC, "combined_tree_state")
203#define tr_op tr_a.tu_op
204#define tr_regionp tr_a.tu_regionp
206#define TREE_NULL ((union tree *)0)
207#define RT_CK_TREE(_p) BU_CKMAG(_p, RT_TREE_MAGIC, "union tree")
214#define RT_TREE_INIT(_p) { \
215 (_p)->magic = RT_TREE_MAGIC; \
216 (_p)->tr_b.tb_op = 0; \
217 (_p)->tr_b.tb_regionp = NULL; \
218 (_p)->tr_b.tb_left = NULL; \
219 (_p)->tr_b.tb_right = NULL; \
231#define TREE_LIST_NULL ((struct tree_list *)0)
238#define UOP_INTERSECT 2
239#define UOP_SUBTRACT 3
404 void *,
void *,
void *,
void *),
619 void (*leaf_func)(
struct db_i *,
630 void (*leaf_func)(
struct db_i *,
Header file for the BRL-CAD common definitions.
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Global registry of recognized magic numbers.
Region-ID-based material/color table management for BRL-CAD databases.
struct db_full_path cts_p
struct db_tree_state cts_s
void(* comb_exit_func)(struct db_i *, struct directory *, void *)
void(* leaf_func)(struct db_i *, struct directory *, void *)
void(* comb_enter_func)(struct db_i *, struct directory *, void *)
int ts_los
equivalent LOS estimate
struct mater_info ts_mater
material properties
const struct bg_tess_tol * ts_ttol
Tessellation tolerance.
int ts_is_fastgen
REGION_NON_FASTGEN/_PLATE/_VOLUME.
struct rt_i * ts_rtip
Helper for rt_gettrees()
int ts_regionid
GIFT compat region ID code.
struct bu_attribute_value_set ts_attrs
attribute/value structure
const struct bn_tol * ts_tol
Math tolerance.
struct model ** ts_m
ptr to ptr to NMG "model"
int(* ts_region_start_func)(struct db_tree_state *tsp, const struct db_full_path *pathp, const struct rt_comb_internal *comb, void *client_data)
callback during DAG downward traversal called on region nodes
int ts_aircode
GIFT compat air code.
mat_t ts_mat
transform matrix
int ts_stop_at_regions
else stop at solids
int ts_gmater
GIFT compat material code.
struct region * tc_pad
unused
struct combined_tree_state * tc_ctsp
int tl_op
leaf, OP_DB_LEAF
char * tl_name
Name of this leaf (bu_strdup'ed)
matp_t tl_mat
xform matp, NULL ==> identity
struct region * tu_regionp
ptr to containing region
struct region * tb_regionp
ptr to containing region
struct rt_db_internal * td_i
For special cases like half spaces.
const char * td_name
If non-null, dynamic string describing heritage of this region.
void * td_d
tessellation related data
struct nmgregion * td_r
ptr to NMG region
union tree * db_dup_subtree(const union tree *tp)
union tree * db_find_named_leaf(union tree *tp, const char *cp)
int db_follow_path_for_state(struct db_tree_state *tsp, struct db_full_path *pathp, const char *orig_str, int noisy)
void db_init_db_tree_state(struct db_tree_state *tsp, struct db_i *dbip)
int db_walk_tree(struct db_i *dbip, int argc, const char **argv, int ncpu, const struct db_tree_state *init_state, int(*reg_start_func)(struct db_tree_state *, const struct db_full_path *, const struct rt_comb_internal *, void *client_data), union tree *(*reg_end_func)(struct db_tree_state *, const struct db_full_path *, union tree *, void *client_data), union tree *(*leaf_func)(struct db_tree_state *, const struct db_full_path *, struct rt_db_internal *, void *client_data), void *client_data)
DEPRECATED void db_functree(struct db_i *dbip, struct directory *dp, void(*comb_func)(struct db_i *, struct directory *, void *), void(*leaf_func)(struct db_i *, struct directory *, void *), struct resource *resp, void *client_data)
void db_treewalk_basic(struct db_i *dbip, struct directory *dp, void(*comb_func)(struct db_i *, struct directory *, void *), void(*leaf_func)(struct db_i *, struct directory *, void *), void *client_data)
void db_pr_tree_state(const struct db_tree_state *tsp)
int db_apply_state_from_memb(struct db_tree_state *tsp, struct db_full_path *pathp, const union tree *tp)
struct combined_tree_state * db_dup_combined_tree_state(const struct combined_tree_state *old)
void db_free_tree(union tree *tp)
int db_follow_path(struct db_tree_state *tsp, struct db_full_path *total_path, const struct db_full_path *new_path, int noisy, long pdepth)
void rt_pr_tree_val(const union tree *tp, const struct partition *partp, int pr_name, int lvl)
void db_pr_combined_tree_state(const struct combined_tree_state *ctsp)
int db_tree_rm_dbleaf(union tree **tp, const char *cp, int nflag)
int db_apply_state_from_one_member(struct db_tree_state *tsp, struct db_full_path *pathp, const char *cp, int sofar, const union tree *tp)
void db_free_combined_tree_state(struct combined_tree_state *ctsp)
union tree * db_mkbool_tree(struct rt_tree_array *rt_tree_array, size_t howfar)
void db_tree_del_lhs(union tree *tp)
int db_ck_v4gift_tree(const union tree *tp)
struct combined_tree_state * db_new_combined_tree_state(const struct db_tree_state *tsp, const struct db_full_path *pathp)
union tree * db_tree_parse(struct bu_vls *vls, const char *str)
union tree * db_recurse(struct db_tree_state *tsp, struct db_full_path *pathp, struct combined_tree_state **region_start_statepp, void *client_data)
int db_tally_subtree_regions(union tree *tp, union tree **reg_trees, int cur, int lim)
void db_non_union_push(union tree *tp)
int db_is_tree_all_unions(const union tree *tp)
void db_ck_tree(const union tree *tp)
void rt_pr_tree_vls(struct bu_vls *vls, const union tree *tp)
int rt_tree_elim_nops(union tree *)
void db_tree_del_rhs(union tree *tp)
void db_tree_flatten_describe(struct bu_vls *vls, const union tree *tp, int indented, int lvl, double mm2local)
void rt_optim_tree(union tree *tp, struct resource *resp)
void db_free_db_tree_state(struct db_tree_state *tsp)
char * rt_pr_tree_str(const union tree *tree)
void db_left_hvy_node(union tree *tp)
struct rt_tree_array * db_flatten_tree(struct rt_tree_array *rt_tree_array, union tree *tp, int op, int freeflag)
void db_dup_db_tree_state(struct db_tree_state *otsp, const struct db_tree_state *itsp)
int db_count_tree_nodes(const union tree *tp, int count)
union tree * db_mkgift_tree(struct rt_tree_array *trees, size_t subtreecount)
int db_apply_state_from_comb(struct db_tree_state *tsp, const struct db_full_path *pathp, const struct rt_comb_internal *comb)
DEPRECATED int db_tree_del_dbleaf(union tree **tp, const char *cp, struct resource *resp, int nflag)
void db_tree_mul_dbleaf(union tree *tp, const mat_t mat)
int rt_bound_tree(const union tree *tp, vect_t tree_min, vect_t tree_max)
union tree * db_find_named_leafs_parent(int *side, union tree *tp, const char *cp)
size_t db_tree_nleaves(const union tree *tp)
void rt_pr_tree(const union tree *tp, int lvl)
int db_tree_list(struct bu_vls *vls, const union tree *tp)
int db_ck_left_heavy_tree(const union tree *tp, int no_unions)
void db_tree_funcleaf(struct db_i *dbip, struct rt_comb_internal *comb, union tree *comb_tree, void(*leaf_func)(struct db_i *, struct rt_comb_internal *, union tree *, void *, void *, void *, void *), void *user_ptr1, void *user_ptr2, void *user_ptr3, void *user_ptr4)
int db_count_subtree_regions(const union tree *tp)
void db_tree_describe(struct bu_vls *vls, const union tree *tp, int indented, int lvl, double mm2local)
struct tree::tree_cts tr_c
struct tree::tree_node tr_b
uint32_t magic
First word: magic number.
struct tree::tree_leaf tr_a
struct tree::tree_tessellation tr_d
struct tree::tree_db_leaf tr_l
fundamental vector, matrix, quaternion math macros