BRL-CAD
table.c File Reference
#include "common.h"
#include <string.h>
#include <math.h>
#include "bio.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "raytrace.h"
#include "rtgeom.h"
Include dependency graph for table.c:

Go to the source code of this file.

Macros

#define RT_DECLARE_INTERFACE(name)
 

Functions

 RT_DECLARE_INTERFACE (tor)
 
 RT_DECLARE_INTERFACE (tgc)
 
 RT_DECLARE_INTERFACE (ell)
 
 RT_DECLARE_INTERFACE (arb)
 
 RT_DECLARE_INTERFACE (ars)
 
 RT_DECLARE_INTERFACE (hlf)
 
 RT_DECLARE_INTERFACE (rec)
 
 RT_DECLARE_INTERFACE (pg)
 
 RT_DECLARE_INTERFACE (nurb)
 
 RT_DECLARE_INTERFACE (sph)
 
 RT_DECLARE_INTERFACE (ebm)
 
 RT_DECLARE_INTERFACE (vol)
 
 RT_DECLARE_INTERFACE (arbn)
 
 RT_DECLARE_INTERFACE (pipe)
 
 RT_DECLARE_INTERFACE (part)
 
 RT_DECLARE_INTERFACE (nmg)
 
 RT_DECLARE_INTERFACE (rpc)
 
 RT_DECLARE_INTERFACE (rhc)
 
 RT_DECLARE_INTERFACE (epa)
 
 RT_DECLARE_INTERFACE (ehy)
 
 RT_DECLARE_INTERFACE (eto)
 
 RT_DECLARE_INTERFACE (grp)
 
 RT_DECLARE_INTERFACE (hf)
 
 RT_DECLARE_INTERFACE (dsp)
 
 RT_DECLARE_INTERFACE (sketch)
 
 RT_DECLARE_INTERFACE (extrude)
 
 RT_DECLARE_INTERFACE (submodel)
 
 RT_DECLARE_INTERFACE (cline)
 
 RT_DECLARE_INTERFACE (bot)
 
 RT_DECLARE_INTERFACE (superell)
 
 RT_DECLARE_INTERFACE (metaball)
 
 RT_DECLARE_INTERFACE (hyp)
 
 RT_DECLARE_INTERFACE (revolve)
 
 RT_DECLARE_INTERFACE (constraint)
 
 RT_DECLARE_INTERFACE (pnts)
 
 RT_DECLARE_INTERFACE (hrt)
 
 RT_DECLARE_INTERFACE (joint)
 
int rt_generic_get (struct bu_vls *, const struct rt_db_internal *, const char *)
 
int rt_generic_adjust (struct bu_vls *, struct rt_db_internal *, int, const char **)
 
int rt_generic_form (struct bu_vls *, const struct rt_functab *)
 
void rt_generic_make (const struct rt_functab *, struct rt_db_internal *)
 
int rt_generic_xform (struct rt_db_internal *, const mat_t, struct rt_db_internal *, int, struct db_i *, struct resource *)
 
int rt_generic_class (const struct soltab *, const vect_t, const vect_t, const struct bn_tol *)
 
int rt_binunif_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
 
int rt_binunif_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp)
 
void rt_binunif_ifree (struct rt_db_internal *ip)
 
int rt_binunif_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local, struct resource *resp, struct db_i *db_i)
 
void rt_binunif_make (const struct rt_functab *ftp, struct rt_db_internal *intern)
 
int rt_binunif_get (struct bu_vls *logstr, const struct rt_db_internal *intern, const char *attr)
 
int rt_binunif_adjust (struct bu_vls *logstr, struct rt_db_internal *intern, int argc, const char **argv)
 
int rt_comb_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip, struct resource *resp)
 
int rt_comb_import5 (struct rt_db_internal *ip, const struct bu_external *ep, const mat_t mat, const struct db_i *dbip, struct resource *resp)
 
int rt_comb_get (struct bu_vls *logstr, const struct rt_db_internal *intern, const char *item)
 
int rt_comb_adjust (struct bu_vls *logstr, struct rt_db_internal *intern, int argc, const char **argv)
 
int rt_comb_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
void rt_comb_make (const struct rt_functab *ftp, struct rt_db_internal *intern)
 
void rt_comb_ifree (struct rt_db_internal *ip)
 
int rt_ebm_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
int rt_bot_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
int rt_sketch_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
int rt_cline_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
int rt_extrude_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 
int rt_id_solid (struct bu_external *ep)
 
const struct rt_functabrt_get_functab_by_label (const char *label)
 

Variables

const struct rt_functab OBJ []
 

Detailed Description

Tables for the BRL-CAD Package ray-tracing library "librt".

Definition in file table.c.

Macro Definition Documentation

#define RT_DECLARE_INTERFACE (   name)

Definition at line 43 of file table.c.

Function Documentation

RT_DECLARE_INTERFACE ( tor  )
RT_DECLARE_INTERFACE ( tgc  )
RT_DECLARE_INTERFACE ( ell  )
RT_DECLARE_INTERFACE ( arb  )
RT_DECLARE_INTERFACE ( ars  )
RT_DECLARE_INTERFACE ( hlf  )
RT_DECLARE_INTERFACE ( rec  )
RT_DECLARE_INTERFACE ( pg  )
RT_DECLARE_INTERFACE ( nurb  )
RT_DECLARE_INTERFACE ( sph  )
RT_DECLARE_INTERFACE ( ebm  )
RT_DECLARE_INTERFACE ( vol  )
RT_DECLARE_INTERFACE ( arbn  )
RT_DECLARE_INTERFACE ( pipe  )
RT_DECLARE_INTERFACE ( part  )
RT_DECLARE_INTERFACE ( nmg  )
RT_DECLARE_INTERFACE ( rpc  )
RT_DECLARE_INTERFACE ( rhc  )
RT_DECLARE_INTERFACE ( epa  )
RT_DECLARE_INTERFACE ( ehy  )
RT_DECLARE_INTERFACE ( eto  )
RT_DECLARE_INTERFACE ( grp  )
RT_DECLARE_INTERFACE ( hf  )
RT_DECLARE_INTERFACE ( dsp  )
RT_DECLARE_INTERFACE ( sketch  )
RT_DECLARE_INTERFACE ( extrude  )
RT_DECLARE_INTERFACE ( submodel  )
RT_DECLARE_INTERFACE ( cline  )
RT_DECLARE_INTERFACE ( bot  )
RT_DECLARE_INTERFACE ( superell  )
RT_DECLARE_INTERFACE ( metaball  )
RT_DECLARE_INTERFACE ( hyp  )
RT_DECLARE_INTERFACE ( revolve  )
RT_DECLARE_INTERFACE ( constraint  )
RT_DECLARE_INTERFACE ( pnts  )
RT_DECLARE_INTERFACE ( hrt  )
RT_DECLARE_INTERFACE ( joint  )
int rt_generic_get ( struct bu_vls logstr,
const struct rt_db_internal intern,
const char *  attr 
)

This is the generic routine to be listed in OBJ[].ft_get for those solid types which are fully described by their ft_parsetab entry.

'attr' is specified to retrieve only one attribute, rather than all. Example: "db get ell.s B" to get only the B vector.

Definition at line 142 of file generic.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_struct_item(), bu_vls_struct_item_named(), bu_vls_trunc(), rt_functab::ft_label, rt_functab::ft_parsetab, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, RT_CK_DB_INTERNAL, RT_CK_FUNCTAB, bu_structparse::sp_count, and bu_structparse::sp_name.

Here is the call graph for this function:

int rt_generic_adjust ( struct bu_vls logstr,
struct rt_db_internal intern,
int  argc,
const char **  argv 
)

For those solids entirely defined by their parsetab. Invoked via OBJ[].ft_adjust()

Definition at line 217 of file generic.c.

References BRLCAD_ERROR, bu_structparse_argv(), bu_vls_printf(), rt_functab::ft_label, rt_functab::ft_parsetab, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, RT_CK_DB_INTERNAL, and RT_CK_FUNCTAB.

Here is the call graph for this function:

int rt_generic_form ( struct bu_vls logstr,
const struct rt_functab ftp 
)

Invoked via OBJ[].ft_form() on solid types which are fully described by their bu_structparse table in ft_parsetab.

Definition at line 249 of file generic.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_structparse_get_terse_form(), bu_vls_printf(), rt_functab::ft_label, rt_functab::ft_parsetab, and RT_CK_FUNCTAB.

Here is the call graph for this function:

void rt_generic_make ( const struct rt_functab ftp,
struct rt_db_internal intern 
)

This one assumes that making all the parameters null is fine.

Definition at line 200 of file generic.c.

References BU_ASSERT, bu_calloc(), rt_functab::ft_internal_magic, rt_functab::ft_internal_size, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, and OBJ.

Referenced by ged_put().

Here is the call graph for this function:

int rt_generic_class ( const struct soltab s,
const vect_t  v0,
const vect_t  v2,
const struct bn_tol b 
)

Invoked via OBJ[].ft_form() on solid types which are fully described by their bu_structparse table in ft_parsetab.

Definition at line 239 of file generic.c.

int rt_binunif_import5 ( struct rt_db_internal ip,
const struct bu_external ep,
const mat_t  mat,
const struct db_i dbip,
struct resource resp 
)
int rt_binunif_export5 ( struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp 
)

Create the "body" portion of external form

Definition at line 229 of file db5_bin.c.

References bu_bomb(), bu_cv_cookie(), bu_cv_htond(), bu_cv_htonf(), bu_cv_optimize(), bu_cv_w_cookie(), BU_EXTERNAL_INIT, bu_log(), bu_malloc(), rt_binunif_internal::count, bu_external::ext_buf, bu_external::ext_nbytes, rt_db_internal::idb_ptr, RT_CK_BINUNIF, RT_CK_DB_INTERNAL, RT_CK_DBI, RT_CK_RESOURCE, SIZEOF_NETWORK_DOUBLE, SIZEOF_NETWORK_FLOAT, rt_binunif_internal::type, rt_binunif_internal::u, and rt_binunif_internal::uint8.

Referenced by rt_binunif_get().

Here is the call graph for this function:

void rt_binunif_ifree ( struct rt_db_internal ip)

Free the storage associated with the rt_db_internal version of this thing.

Definition at line 391 of file db5_bin.c.

References bu_free(), rt_db_internal::idb_ptr, RT_CK_BINUNIF, RT_CK_DB_INTERNAL, rt_binunif_internal::u, and rt_binunif_internal::uint8.

Here is the call graph for this function:

int rt_binunif_describe ( struct bu_vls str,
const struct rt_db_internal ip,
int  verbose,
double  mm2local,
struct resource resp,
struct db_i db_i 
)
int rt_binunif_get ( struct bu_vls logstr,
const struct rt_db_internal intern,
const char *  attr 
)

Definition at line 516 of file db5_bin.c.

References BRLCAD_ERROR, BRLCAD_OK, bu_free_external(), BU_STR_EQUAL, bu_vls_printf(), bu_vls_strcat(), bu_vls_strcpy(), rt_db_internal::idb_ptr, rt_binunif_export5(), RT_CHECK_BINUNIF, and rt_binunif_internal::type.

Here is the call graph for this function:

int rt_binunif_adjust ( struct bu_vls logstr,
struct rt_db_internal intern,
int  argc,
const char **  argv 
)
int rt_comb_export5 ( struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip,
struct resource resp 
)

Definition at line 252 of file comb.c.

References rt_comb_internal::aircode, BU_ASSERT_PTR, BU_ASSERT_SIZE_T, bu_avs_add(), bu_avs_add_vls(), bu_avs_init(), BU_AVS_MAGIC, bu_avs_remove(), bu_bomb(), bu_calloc(), BU_EXTERNAL_INIT, bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_strlen(), bu_vls_trunc(), db5_encode_length(), db5_select_length_encoding(), db_tree_counter(), DB_TREE_COUNTER_STATE_MAGIC, rt_comb_v5_serialize_state::exprp, bu_external::ext_buf, bu_external::ext_nbytes, rt_comb_internal::GIFTmater, ID_COMBINATION, rt_db_internal::idb_avs, rt_db_internal::idb_ptr, if(), rt_comb_internal::inherit, rt_comb_internal::is_fastgen, db_tree_counter_state::leafbytes, rt_comb_v5_serialize_state::leafp, rt_comb_internal::los, db_tree_counter_state::magic, bu_attribute_value_set::magic, rt_comb_v5_serialize_state::magic, rt_comb_v5_serialize_state::mat_num, rt_comb_v5_serialize_state::matp, memset(), db_tree_counter_state::n_leaf, db_tree_counter_state::n_mat, db_tree_counter_state::n_oper, rt_comb_v5_serialize_state::nmat, db_tree_counter_state::non_union_seen, REGION_FASTGEN_PLATE, REGION_FASTGEN_VOLUME, rt_comb_internal::region_flag, rt_comb_internal::region_id, REGION_NON_FASTGEN, rt_comb_internal::rgb, rt_comb_internal::rgb_valid, RT_CK_COMB, RT_CK_DB_INTERNAL, RT_CK_DBI, RT_CK_RESOURCE, rt_comb_v5_serialize(), RT_COMB_V5_SERIALIZE_STATE_MAGIC, rt_comb_internal::shader, SIZEOF_NETWORK_DOUBLE, rt_comb_internal::tree, V3ARGS, and rt_comb_v5_serialize_state::wid.

Here is the call graph for this function:

int rt_comb_get ( struct bu_vls logstr,
const struct rt_db_internal intern,
const char *  item 
)

Sets the result string to a description of the given combination. Entered via OBJ[].ft_get().

Definition at line 793 of file comb.c.

References rt_comb_internal::aircode, BRLCAD_ERROR, BRLCAD_OK, BU_STR_EQUAL, bu_vls_addr(), bu_vls_printf(), bu_vls_putc(), bu_vls_strlen(), db_tree_list(), rt_comb_internal::GIFTmater, rt_db_internal::idb_ptr, rt_comb_internal::inherit, rt_comb_internal::los, rt_comb_internal::material, rt_comb_internal::region_flag, rt_comb_internal::region_id, rt_comb_internal::rgb, rt_comb_internal::rgb_valid, RT_CK_COMB, RT_CK_DB_INTERNAL, rt_comb_internal::shader, rt_comb_internal::tree, and V3ARGS.

Here is the call graph for this function:

int rt_comb_adjust ( struct bu_vls logstr,
struct rt_db_internal intern,
int  argc,
const char **  argv 
)
int rt_comb_form ( struct bu_vls logstr,
const struct rt_functab ftp 
)

Definition at line 1069 of file comb.c.

References BRLCAD_OK, bu_vls_printf(), and RT_CK_FUNCTAB.

Here is the call graph for this function:

void rt_comb_make ( const struct rt_functab ftp,
struct rt_db_internal intern 
)

Create a blank combination with appropriate values. Called via OBJ[ID_COMBINATION].ft_make().

Definition at line 1084 of file comb.c.

References BU_ALLOC, bu_vls_init(), ID_COMBINATION, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, rt_comb_internal::material, OBJ, RT_COMB_INTERNAL_INIT, and rt_comb_internal::shader.

Here is the call graph for this function:

int rt_sketch_form ( struct bu_vls logstr,
const struct rt_functab ftp 
)

Definition at line 2340 of file sketch.c.

References BRLCAD_OK, BU_CK_VLS, bu_vls_printf(), and RT_CK_FUNCTAB.

Here is the call graph for this function: