BRL-CAD
reg.c File Reference
#include "common.h"
#include <math.h>
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "bn.h"
#include "raytrace.h"
#include "wdb.h"
Include dependency graph for reg.c:

Go to the source code of this file.

Functions

void mk_tree_pure (struct rt_comb_internal *comb, struct bu_list *member_hd)
 
int mk_tree_gift (struct rt_comb_internal *comb, struct bu_list *member_hd)
 
struct wmembermk_addmember (const char *name, struct bu_list *headp, mat_t mat, int op)
 
void mk_freemembers (struct bu_list *headp)
 
int mk_comb (struct rt_wdb *wdbp, const char *combname, struct bu_list *headp, int region_kind, const char *shadername, const char *shaderargs, const unsigned char *rgb, int id, int air, int material, int los, int inherit, int append_ok, int gift_semantics)
 
int mk_comb1 (struct rt_wdb *wdbp, const char *combname, const char *membname, int regflag)
 
int mk_region1 (struct rt_wdb *wdbp, const char *combname, const char *membname, const char *shadername, const char *shaderargs, const unsigned char *rgb)
 

Detailed Description

Library for writing MGED databases from arbitrary procedures.

This module contains routines to create combinations, and regions.

It is expected that this library will grow as experience is gained.

Definition in file reg.c.

Function Documentation

void mk_tree_pure ( struct rt_comb_internal comb,
struct bu_list member_hd 
)

Given a list of wmember structures, build a tree that performs the boolean operations in the given sequence. No GIFT semantics or precedence is provided. For that, use mk_tree_gift().

Definition at line 47 of file reg.c.

References bn_mat_dup(), bn_mat_is_identity(), BU_ALLOC, bu_bomb(), BU_LIST_FOR, bu_strdup, OP_DB_LEAF, OP_INTERSECT, OP_SUBTRACT, OP_UNION, RT_TREE_INIT, tree::tree_node::tb_left, tree::tree_node::tb_op, tree::tree_node::tb_right, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tree_db_leaf::tl_op, tree::tr_b, tree::tr_l, rt_comb_internal::tree, WDB_CK_WMEMBER, wmember::wm_mat, wmember::wm_name, wmember::wm_op, WMOP_INTERSECT, WMOP_SUBTRACT, and WMOP_UNION.

Referenced by mk_comb().

Here is the call graph for this function:

int mk_tree_gift ( struct rt_comb_internal comb,
struct bu_list member_hd 
)

Add some nodes to a new or existing combination's tree, with GIFT precedence and semantics.

NON-PARALLEL due to rt_uniresource

Returns - -1 ERROR 0 OK

Definition at line 102 of file reg.c.

References bn_mat_dup(), bn_mat_is_identity(), BU_ALLOC, BU_ASSERT_SIZE_T, bu_calloc(), bu_free(), BU_LIST_FOR, bu_list_len(), bu_log(), bu_strdup, db_ck_v4gift_tree(), db_flatten_tree(), db_mkgift_tree(), db_non_union_push(), db_tree_nleaves(), OP_DB_LEAF, OP_INTERSECT, OP_SUBTRACT, OP_UNION, RT_TREE_INIT, rt_uniresource, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tree_db_leaf::tl_op, rt_tree_array::tl_op, rt_tree_array::tl_tree, tree::tr_l, rt_comb_internal::tree, TREE_NULL, WDB_CK_WMEMBER, wmember::wm_mat, wmember::wm_name, wmember::wm_op, WMOP_INTERSECT, WMOP_SUBTRACT, and WMOP_UNION.

Referenced by mk_comb().

Here is the call graph for this function: