BRL-CAD
vrml_write.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <math.h>
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "bu/getopt.h"
#include "bu/units.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "wdb.h"
#include "../../plugin.h"
Include dependency graph for vrml_write.c:

Go to the source code of this file.

Data Structures

struct  plate_mode
 
struct  vrml_mat
 

Macros

#define TXT_BUF_LEN   512
 
#define TXT_NAME_SIZE   128
 
#define PL_O(_m)   bu_offsetof(struct vrml_mat, _m)
 

Functions

union treedo_region_end1 (struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
 
union treedo_region_end2 (struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
 
union treenmg_region_end (struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
 
struct rt_bot_internal * dup_bot (struct rt_bot_internal *bot_in)
 
union treeleaf_tess1 (struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data)
 
union treeleaf_tess2 (struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data)
 
void nmg_2_vrml (struct db_tree_state *tsp, const struct db_full_path *pathp, struct model *m)
 
void bot2vrml (struct plate_mode *pmp, const struct db_full_path *pathp, int region_id)
 

Variables

const struct bu_structparse vrml_mat_parse []
 
const struct gcv_plugin_info gcv_plugin_conv_vrml_write = {converters}
 

Detailed Description

Program to convert a BRL-CAD model (in a .g file) to a VRML (2.0) faceted model by calling on the NMG booleans.

Definition in file vrml_write.c.

Macro Definition Documentation

#define TXT_BUF_LEN   512

Definition at line 49 of file vrml_write.c.

Referenced by nmg_2_vrml().

#define TXT_NAME_SIZE   128

Definition at line 50 of file vrml_write.c.

Referenced by nmg_2_vrml().

#define PL_O (   _m)    bu_offsetof(struct vrml_mat, _m)

Definition at line 76 of file vrml_write.c.

Function Documentation

union tree * do_region_end1 ( struct db_tree_state tsp,
const struct db_full_path pathp,
union tree curtree,
void *  client_data 
)

Definition at line 1161 of file vrml_write.c.

References bot2vrml(), bu_bomb(), bu_free(), bu_log(), db_path_to_string(), DEBUG_TREEWALK, nmg_region_end(), plate_mode::num_bots, plate_mode::num_nonbots, RT_G_DEBUG, and db_tree_state::ts_regionid.

Here is the call graph for this function:

union tree * do_region_end2 ( struct db_tree_state tsp,
const struct db_full_path pathp,
union tree curtree,
void *  client_data 
)

Definition at line 1197 of file vrml_write.c.

References bot2vrml(), bu_free(), bu_log(), db_path_to_string(), DEBUG_TREEWALK, plate_mode::num_bots, RT_G_DEBUG, db_tree_state::ts_regionid, and verbose().

Here is the call graph for this function:

union tree * nmg_region_end ( struct db_tree_state tsp,
const struct db_full_path pathp,
union tree curtree,
void *  client_data 
)

Definition at line 1254 of file vrml_write.c.

References BN_CK_TOL, BU_ALLOC, bu_free(), BU_LIST_FIRST, BU_LIST_INIT, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, bu_log(), db_free_tree(), db_path_to_string(), DEBUG_TREEWALK, nmg_2_vrml(), nmg_keu_zl(), nmg_kill_cracks(), nmg_ks(), OP_NOP, RT_CK_TESS_TOL, RT_G_DEBUG, RT_TREE_INIT, rt_uniresource, s, tree::tree_nmgregion::td_r, tree::tr_d, db_tree_state::ts_m, db_tree_state::ts_tol, and db_tree_state::ts_ttol.

Referenced by do_region_end1().

Here is the call graph for this function:

struct rt_bot_internal* dup_bot ( struct rt_bot_internal *  bot_in)

Definition at line 150 of file vrml_write.c.

References BU_ALLOC, bu_bitv_dup(), bu_bomb(), and bu_calloc().

Referenced by leaf_tess1(), and leaf_tess2().

Here is the call graph for this function:

union tree* leaf_tess1 ( struct db_tree_state tsp,
const struct db_full_path pathp,
struct rt_db_internal ip,
void *  client_data 
)

Definition at line 287 of file vrml_write.c.

References plate_mode::array_size, plate_mode::bots, bu_realloc(), dup_bot(), ID_BOT, rt_db_internal::idb_ptr, nmg_booltree_leaf_tess(), plate_mode::num_bots, and plate_mode::num_nonbots.

Here is the call graph for this function:

union tree* leaf_tess2 ( struct db_tree_state tsp,
const struct db_full_path pathp,
struct rt_db_internal ip,
void *  client_data 
)

Definition at line 321 of file vrml_write.c.

References plate_mode::array_size, plate_mode::bots, bu_realloc(), dup_bot(), ID_BOT, rt_db_internal::idb_ptr, and plate_mode::num_bots.

Here is the call graph for this function:

void bot2vrml ( struct plate_mode pmp,
const struct db_full_path pathp,
int  region_id 
)

Definition at line 1099 of file vrml_write.c.

References plate_mode::bots, bu_free(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, db_path_to_string(), plate_mode::num_bots, and V3ARGS.

Referenced by do_region_end1(), and do_region_end2().

Here is the call graph for this function:

Variable Documentation

const struct bu_structparse vrml_mat_parse[]
Initial value:
={
{"%s", TXT_NAME_SIZE, "ma_shader", PL_O(shader), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "shine",PL_O(shininess),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "sh",PL_O(shininess),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "transmit",PL_O(transparency),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "tr",PL_O(transparency),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 1, "angle",PL_O(lt_angle),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 1, "fract",PL_O(lt_fraction),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%f", 3, "aim",PL_O(lt_dir),BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "w", PL_O(tx_w), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "n", PL_O(tx_n), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%s", TXT_NAME_SIZE, "file",PL_O(tx_file), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"",0, (char *)0,0,BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define PL_O(_m)
Definition: vrml_write.c:76
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define TXT_NAME_SIZE
Definition: vrml_write.c:50
ustring shader

Definition at line 78 of file vrml_write.c.

const struct gcv_plugin_info gcv_plugin_conv_vrml_write = {converters}

Definition at line 769 of file vrml_write.c.