tcl.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include <strings.h>
#include "tcl.h"
#include "machine.h"
#include "bu.h"
#include "vmath.h"
#include "bn.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "./debug.h"

Include dependency graph for tcl.c:

Go to the source code of this file.

Data Structures

struct  dbcmdstruct

Functions

int Wdb_Init (Tcl_Interp *interp)
int Dgo_Init (Tcl_Interp *interp)
int Vo_Init (Tcl_Interp *interp)
int rt_tcl_parse_ray (Tcl_Interp *interp, struct xray *rp, const char *const *argv)
void rt_tcl_pr_cutter (Tcl_Interp *interp, const union cutter *cutp)
int rt_tcl_cutter (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
void rt_tcl_pr_hit (Tcl_Interp *interp, struct hit *hitp, const struct seg *segp, const struct xray *rayp, int flipflag)
int rt_tcl_a_hit (struct application *ap, struct partition *PartHeadp, struct seg *segHeadp)
int rt_tcl_a_miss (struct application *ap)
int rt_tcl_rt_shootray (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
int rt_tcl_rt_onehit (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
int rt_tcl_rt_no_bool (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
int rt_tcl_rt_check (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
int rt_tcl_rt_prep (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv)
int rt_tcl_rt (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
void db_tcl_tree_describe (Tcl_DString *dsp, const union tree *tp)
treedb_tcl_tree_parse (Tcl_Interp *interp, const char *str, struct resource *resp)
int rt_comb_tclget (Tcl_Interp *interp, const struct rt_db_internal *intern, const char *item)
int rt_comb_tcladjust (Tcl_Interp *interp, struct rt_db_internal *intern, int argc, char **argv, struct resource *resp)
int rt_tcl_import_from_path (Tcl_Interp *interp, struct rt_db_internal *ip, const char *path, struct rt_wdb *wdb)
int rt_parsetab_tclget (Tcl_Interp *interp, const struct rt_db_internal *intern, const char *attr)
int rt_comb_tclform (const struct rt_functab *ftp, Tcl_Interp *interp)
void rt_comb_make (const struct rt_functab *ftp, struct rt_db_internal *intern, double diameter)
void rt_generic_make (const struct rt_functab *ftp, struct rt_db_internal *intern, double diameter)
int rt_parsetab_tcladjust (Tcl_Interp *interp, struct rt_db_internal *intern, int argc, char **argv)
int rt_parsetab_tclform (const struct rt_functab *ftp, Tcl_Interp *interp)
void rt_tcl_setup (Tcl_Interp *interp)
int Rt_Init (Tcl_Interp *interp)
void db_full_path_appendresult (Tcl_Interp *interp, const struct db_full_path *pp)
int tcl_obj_to_int_array (Tcl_Interp *interp, Tcl_Obj *list, int **array, int *array_len)
int tcl_list_to_int_array (Tcl_Interp *interp, char *char_list, int **array, int *array_len)
int tcl_obj_to_fastf_array (Tcl_Interp *interp, Tcl_Obj *list, fastf_t **array, int *array_len)
int tcl_list_to_fastf_array (Tcl_Interp *interp, char *char_list, fastf_t **array, int *array_len)


Detailed Description

Tcl interfaces to LIBRT routines.

LIBRT routines are not for casual command-line use; as a result, the Tcl name for the function should be exactly the same as the C name for the underlying function. Typing "rt_" is no hardship when writing Tcl procs, and clarifies the origin of the routine.

Authors - Michael John Muuss Glenn Durfee

Source - The U. S. Army Research Laboratory Aberdeen Proving Ground, Maryland 21005-5068 USA

Definition in file tcl.c.


Function Documentation

int Wdb_Init Tcl_Interp interp  ) 
 

Definition at line 410 of file wdb_obj.c.

References interp, NULL, TCL_OK, and void().

Referenced by rt_tcl_setup().

Here is the call graph for this function:

int Vo_Init Tcl_Interp interp  ) 
 

Definition at line 165 of file view_obj.c.

References BU_LIST_INIT, HeadViewObj, interp, view_obj::l, NULL, TCL_OK, and void().

Referenced by rt_tcl_setup().

Here is the call graph for this function:

int rt_tcl_a_hit struct application ap,
struct partition PartHeadp,
struct seg segHeadp
 

Definition at line 304 of file tcl.c.

References application::a_ray, application::a_uptr, interp, NULL, RT_CK_PT, RT_CK_PT_HD, and rt_tcl_pr_hit().

Referenced by rt_tcl_rt_shootray().

Here is the call graph for this function:

int rt_tcl_a_miss struct application ap  ) 
 

Definition at line 335 of file tcl.c.

Referenced by rt_tcl_rt_shootray().

int rt_tcl_rt_shootray ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char *const *  argv
 

Definition at line 365 of file tcl.c.

References application::a_ray, application::a_rt_i, application::a_uptr, index, interp, NULL, RT_CK_AP_TCL, RT_CK_RTI_TCL, rt_shootray(), rt_silent_logoverlap(), rt_tcl_a_hit(), rt_tcl_a_miss(), rt_tcl_parse_ray(), TCL_ERROR, TCL_OK, and void().

Here is the call graph for this function:

int rt_tcl_rt_onehit ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char *const *  argv
 

Definition at line 408 of file tcl.c.

References application::a_onehit, application::a_rt_i, interp, NULL, RT_CK_AP_TCL, RT_CK_RTI_TCL, TCL_ERROR, and TCL_OK.

int rt_tcl_rt_no_bool ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char *const *  argv
 

Definition at line 441 of file tcl.c.

References application::a_no_booleans, application::a_rt_i, interp, NULL, RT_CK_AP_TCL, RT_CK_RTI_TCL, TCL_ERROR, and TCL_OK.

int rt_tcl_rt_check ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char *const *  argv
 

Definition at line 476 of file tcl.c.

References application::a_rt_i, interp, NULL, rt_ck(), RT_CK_AP_TCL, RT_CK_RTI_TCL, TCL_ERROR, and TCL_OK.

Here is the call graph for this function:

int rt_tcl_rt_prep ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char *const *  argv
 

Definition at line 508 of file tcl.c.

References application::a_rt_i, bu_vls_addr(), bu_vls_free(), bu_vls_init(), bu_vls_printf(), CUT_BOXNODE, CUT_CUTNODE, CUT_NUGRIDNODE, interp, rt_i::needprep, rt_i::nempty_cells, NULL, RT_CK_AP_TCL, RT_CK_RTI_TCL, RT_PART_NUGRID, rt_prep_parallel(), rt_i::rti_cut_maxdepth, rt_i::rti_cut_maxlen, rt_i::rti_cut_totobj, rt_i::rti_dont_instance, rt_i::rti_hasty_prep, rt_i::rti_ncut_by_type, rt_i::rti_space_partition, TCL_ERROR, TCL_OK, and rt_i::useair.

Here is the call graph for this function:

int rt_tcl_rt ClientData  clientData,
Tcl_Interp interp,
int  argc,
const char **  argv
 

Definition at line 594 of file tcl.c.

References dbcmdstruct::cmdfunc, dbcmdstruct::cmdname, interp, NULL, and TCL_ERROR.

Referenced by wdb_rt_gettrees_cmd().

void db_tcl_tree_describe Tcl_DString dsp,
const union tree tp
 

Definition at line 659 of file tcl.c.

References bn_encode_mat(), bu_bomb(), bu_log(), bu_vls_addr(), bu_vls_free(), bu_vls_init(), OP_DB_LEAF, OP_GUARD, OP_INTERSECT, OP_NOP, OP_NOT, OP_SUBTRACT, OP_UNION, OP_XNOP, OP_XOR, RT_CK_TREE, tree::tree_node::tb_left, tree::tree_node::tb_right, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tr_b, and tree::tr_l.

Referenced by rt_comb_tclget().

Here is the call graph for this function:

union tree* db_tcl_tree_parse Tcl_Interp interp,
const char *  str,
struct resource resp
 

Definition at line 733 of file tcl.c.

References bn_decode_mat(), bn_mat_ck(), bn_mat_dup(), bn_mat_is_identity(), bu_free(), bu_strdup, db_free_tree(), interp, NULL, OP_DB_LEAF, OP_GUARD, OP_INTERSECT, OP_NOT, OP_SUBTRACT, OP_UNION, OP_XNOP, OP_XOR, RT_FREE_TREE, RT_GET_TREE, RT_TREE_MAGIC, TCL_OK, and TREE_NULL.

Here is the call graph for this function:

int rt_comb_tclget Tcl_Interp interp,
const struct rt_db_internal intern,
const char *  item
 

Definition at line 898 of file tcl.c.

References rt_comb_internal::aircode, bu_vls_addr(), bu_vls_strlen(), db_tcl_tree_describe(), rt_comb_internal::GIFTmater, rt_db_internal::idb_ptr, rt_comb_internal::inherit, interp, 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_TCL, RT_CK_DB_INTERNAL, rt_comb_internal::shader, TCL_OK, rt_comb_internal::tree, and V3ARGS.

Here is the call graph for this function:

int rt_comb_tcladjust Tcl_Interp interp,
struct rt_db_internal intern,
int  argc,
char **  argv,
struct resource resp
 

Definition at line 1043 of file tcl.c.

References rt_db_internal::idb_ptr, interp, rt_comb_internal::region_flag, RT_CK_COMB, RT_CK_DB_INTERNAL, RT_CK_RESOURCE, TCL_ERROR, and TCL_OK.

int rt_tcl_import_from_path Tcl_Interp interp,
struct rt_db_internal ip,
const char *  path,
struct rt_wdb wdb
 

Definition at line 1227 of file tcl.c.

References directory::d_namep, db_follow_path(), db_free_full_path(), DB_FULL_PATH_CUR_DIR, db_full_path_init(), db_init_db_tree_state(), db_lookup(), db_string_to_path(), rt_wdb::dbip, interp, LOOKUP_NOISY, LOOKUP_QUIET, NULL, RT_CK_DBI, RT_CK_WDB, rt_db_get_internal(), rt_uniresource, status, TCL_ERROR, TCL_OK, db_tree_state::ts_mat, and wdb_import().

Referenced by wdb_get_cmd(), wdb_get_type_cmd(), wdb_move_arb_edge_cmd(), wdb_move_arb_face_cmd(), and wdb_rotate_arb_face_cmd().

Here is the call graph for this function:

int rt_parsetab_tclget Tcl_Interp interp,
const struct rt_db_internal intern,
const char *  attr
 

Definition at line 1324 of file tcl.c.

References bu_vls_addr(), bu_vls_free(), bu_vls_init(), 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, interp, NULL, RT_CK_DB_INTERNAL, RT_CK_FUNCTAB, bu_structparse::sp_name, status, TCL_ERROR, and TCL_OK.

Here is the call graph for this function:

int rt_comb_tclform const struct rt_functab ftp,
Tcl_Interp interp
 

Definition at line 1383 of file tcl.c.

References interp, NULL, RT_CK_FUNCTAB, and TCL_OK.

void rt_comb_make const struct rt_functab ftp,
struct rt_db_internal intern,
double  diameter
 

Definition at line 1401 of file tcl.c.

References rt_comb_internal::aircode, bu_calloc(), bu_vls_init(), DB5_MAJORTYPE_BRLCAD, rt_comb_internal::GIFTmater, ID_COMBINATION, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, rt_comb_internal::inherit, rt_comb_internal::los, rt_comb_internal::magic, rt_comb_internal::material, rt_comb_internal::region_flag, rt_comb_internal::region_id, rt_comb_internal::rgb, rt_comb_internal::rgb_valid, RT_COMB_MAGIC, rt_comb_internal::shader, rt_comb_internal::temperature, and rt_comb_internal::tree.

Here is the call graph for this function:

void rt_generic_make const struct rt_functab ftp,
struct rt_db_internal intern,
double  diameter
 

Definition at line 1435 of file tcl.c.

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

Here is the call graph for this function:

int rt_parsetab_tcladjust Tcl_Interp interp,
struct rt_db_internal intern,
int  argc,
char **  argv
 

Definition at line 1453 of file tcl.c.

References bu_structparse_argv(), rt_functab::ft_label, rt_functab::ft_parsetab, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, interp, NULL, RT_CK_DB_INTERNAL, RT_CK_FUNCTAB, and TCL_ERROR.

Here is the call graph for this function:

int rt_parsetab_tclform const struct rt_functab ftp,
Tcl_Interp interp
 

Definition at line 1480 of file tcl.c.

References bu_structparse_get_terse_form(), rt_functab::ft_label, rt_functab::ft_parsetab, interp, NULL, RT_CK_FUNCTAB, TCL_ERROR, and TCL_OK.

Here is the call graph for this function:


Generated on Mon Sep 18 01:25:09 2006 for BRL-CAD by  doxygen 1.4.6