BRL-CAD
generic.c File Reference
#include "common.h"
#include <string.h>
#include "bn.h"
#include "raytrace.h"
Include dependency graph for generic.c:

Go to the source code of this file.

Functions

int rt_generic_xform (struct rt_db_internal *op, const mat_t mat, struct rt_db_internal *ip, int release, struct db_i *dbip, struct resource *resp)
 
int rt_generic_get (struct bu_vls *logstr, const struct rt_db_internal *intern, const char *attr)
 
void rt_generic_make (const struct rt_functab *ftp, struct rt_db_internal *intern)
 
int rt_generic_adjust (struct bu_vls *logstr, struct rt_db_internal *intern, int argc, const char **argv)
 
int rt_generic_class (const struct soltab *s, const vect_t v0, const vect_t v2, const struct bn_tol *b)
 
int rt_generic_form (struct bu_vls *logstr, const struct rt_functab *ftp)
 

Detailed Description

Generic routines applicable across most primitives

Definition in file generic.c.

Function Documentation

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:

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_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_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_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: