BRL-CAD
libtclcad (Tcl CAD)

Files

file  tclcad.h
 Header file for the BRL-CAD TclCAD Library, LIBTCLCAD.
 
file  tclcad_obj.c
 

Data Structures

struct  ged_dm_view
 
struct  ged_obj
 
struct  tclcad_obj
 

Macros

#define TCLCAD_IDLE_MODE   0
 
#define TCLCAD_ROTATE_MODE   1
 
#define TCLCAD_TRANSLATE_MODE   2
 
#define TCLCAD_SCALE_MODE   3
 
#define TCLCAD_CONSTRAINED_ROTATE_MODE   4
 
#define TCLCAD_CONSTRAINED_TRANSLATE_MODE   5
 
#define TCLCAD_OROTATE_MODE   6
 
#define TCLCAD_OSCALE_MODE   7
 
#define TCLCAD_OTRANSLATE_MODE   8
 
#define TCLCAD_MOVE_ARB_EDGE_MODE   9
 
#define TCLCAD_MOVE_ARB_FACE_MODE   10
 
#define TCLCAD_ROTATE_ARB_FACE_MODE   11
 
#define TCLCAD_PROTATE_MODE   12
 
#define TCLCAD_PSCALE_MODE   13
 
#define TCLCAD_PTRANSLATE_MODE   14
 
#define TCLCAD_POLY_CIRCLE_MODE   15
 
#define TCLCAD_POLY_CONTOUR_MODE   16
 
#define TCLCAD_POLY_ELLIPSE_MODE   17
 
#define TCLCAD_POLY_RECTANGLE_MODE   18
 
#define TCLCAD_POLY_SQUARE_MODE   19
 
#define TCLCAD_RECTANGLE_MODE   20
 
#define TCLCAD_MOVE_METABALL_POINT_MODE   21
 
#define TCLCAD_MOVE_PIPE_POINT_MODE   22
 
#define TCLCAD_MOVE_BOT_POINT_MODE   23
 
#define TCLCAD_MOVE_BOT_POINTS_MODE   24
 
#define TCLCAD_DATA_MOVE_OBJECT_MODE   25
 
#define TCLCAD_DATA_MOVE_POINT_MODE   26
 
#define TCLCAD_DATA_SCALE_MODE   27
 
#define TCLCAD_OBJ_FB_MODE_OFF   0
 
#define TCLCAD_OBJ_FB_MODE_UNDERLAY   1
 
#define TCLCAD_OBJ_FB_MODE_INTERLAY   2
 
#define TCLCAD_OBJ_FB_MODE_OVERLAY   3
 
#define GED_OBJ_NULL   ((struct ged_obj *)0)
 
#define TCLCAD_OBJ_NULL   (struct tclcad_obj *)0
 

Functions

int tclcad_tk_setup (Tcl_Interp *interp)
 
void tclcad_auto_path (Tcl_Interp *interp)
 
void tclcad_tcl_library (Tcl_Interp *interp)
 
int Tclcad_Init (Tcl_Interp *interp)
 
int Go_Init (Tcl_Interp *interp)
 create the Tcl command for to_open More...
 
int to_open_tcl (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
 A TCL interface to wdb_fopen() and wdb_dbopen(). More...
 
struct applicationto_rt_gettrees_application (struct ged *gedp, int argc, const char *argv[])
 
void go_refresh (struct ged_obj *gop, struct ged_dm_view *gdvp)
 
void go_refresh_draw (struct ged_obj *gop, struct ged_dm_view *gdvp, int restore_zbuffer)
 
int Cho_Init (Tcl_Interp *interp)
 
int cho_open_tcl (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
 
void tclcad_register_cmds (Tcl_Interp *interp, struct bu_cmdtab *cmds)
 

Detailed Description

Macro Definition Documentation

#define TCLCAD_IDLE_MODE   0

Definition at line 57 of file tclcad.h.

Referenced by to_idle_mode().

#define TCLCAD_ROTATE_MODE   1

Definition at line 58 of file tclcad.h.

Referenced by to_rotate_mode().

#define TCLCAD_TRANSLATE_MODE   2

Definition at line 59 of file tclcad.h.

Referenced by to_idle_mode(), and to_translate_mode().

#define TCLCAD_SCALE_MODE   3

Definition at line 60 of file tclcad.h.

Referenced by to_idle_mode(), and to_scale_mode().

#define TCLCAD_CONSTRAINED_ROTATE_MODE   4

Definition at line 61 of file tclcad.h.

Referenced by to_constrain_rmode().

#define TCLCAD_CONSTRAINED_TRANSLATE_MODE   5

Definition at line 62 of file tclcad.h.

Referenced by to_constrain_tmode(), and to_idle_mode().

#define TCLCAD_OROTATE_MODE   6

Definition at line 63 of file tclcad.h.

Referenced by to_orotate_mode().

#define TCLCAD_OSCALE_MODE   7

Definition at line 64 of file tclcad.h.

Referenced by to_oscale_mode().

#define TCLCAD_OTRANSLATE_MODE   8

Definition at line 65 of file tclcad.h.

Referenced by redraw_edited_path(), and to_otranslate_mode().

#define TCLCAD_MOVE_ARB_EDGE_MODE   9

Definition at line 66 of file tclcad.h.

Referenced by to_move_arb_edge_mode().

#define TCLCAD_MOVE_ARB_FACE_MODE   10

Definition at line 67 of file tclcad.h.

Referenced by to_move_arb_face_mode().

#define TCLCAD_ROTATE_ARB_FACE_MODE   11

Definition at line 68 of file tclcad.h.

Referenced by to_rotate_arb_face_mode().

#define TCLCAD_PROTATE_MODE   12

Definition at line 69 of file tclcad.h.

Referenced by to_protate_mode().

#define TCLCAD_PSCALE_MODE   13

Definition at line 70 of file tclcad.h.

Referenced by to_pscale_mode().

#define TCLCAD_PTRANSLATE_MODE   14

Definition at line 71 of file tclcad.h.

Referenced by to_ptranslate_mode().

#define TCLCAD_POLY_CIRCLE_MODE   15

Definition at line 72 of file tclcad.h.

Referenced by to_poly_circ_mode().

#define TCLCAD_POLY_CONTOUR_MODE   16

Definition at line 73 of file tclcad.h.

Referenced by to_extract_contours_av(), to_idle_mode(), and to_poly_cont_build().

#define TCLCAD_POLY_ELLIPSE_MODE   17

Definition at line 74 of file tclcad.h.

Referenced by to_poly_ell_mode().

#define TCLCAD_POLY_RECTANGLE_MODE   18

Definition at line 75 of file tclcad.h.

Referenced by to_poly_rect_mode().

#define TCLCAD_POLY_SQUARE_MODE   19

Definition at line 76 of file tclcad.h.

Referenced by to_mouse_poly_rect(), and to_poly_rect_mode().

#define TCLCAD_RECTANGLE_MODE   20

Definition at line 77 of file tclcad.h.

Referenced by to_rect_mode().

#define TCLCAD_MOVE_METABALL_POINT_MODE   21

Definition at line 78 of file tclcad.h.

Referenced by to_move_metaballpt_mode().

#define TCLCAD_MOVE_PIPE_POINT_MODE   22

Definition at line 79 of file tclcad.h.

Referenced by to_move_pipept_mode().

#define TCLCAD_MOVE_BOT_POINT_MODE   23

Definition at line 80 of file tclcad.h.

Referenced by to_move_botpt_mode().

#define TCLCAD_MOVE_BOT_POINTS_MODE   24

Definition at line 81 of file tclcad.h.

Referenced by to_move_botpts_mode().

#define TCLCAD_DATA_MOVE_OBJECT_MODE   25

Definition at line 82 of file tclcad.h.

Referenced by to_data_move(), and to_data_move_object_mode().

#define TCLCAD_DATA_MOVE_POINT_MODE   26

Definition at line 83 of file tclcad.h.

Referenced by to_data_move_point_mode().

#define TCLCAD_DATA_SCALE_MODE   27

Definition at line 84 of file tclcad.h.

Referenced by to_data_scale_mode().

#define TCLCAD_OBJ_FB_MODE_OFF   0

Definition at line 86 of file tclcad.h.

Referenced by go_refresh().

#define TCLCAD_OBJ_FB_MODE_UNDERLAY   1

Definition at line 87 of file tclcad.h.

Referenced by go_refresh_draw().

#define TCLCAD_OBJ_FB_MODE_INTERLAY   2

Definition at line 88 of file tclcad.h.

Referenced by go_refresh_draw().

#define TCLCAD_OBJ_FB_MODE_OVERLAY   3

Definition at line 89 of file tclcad.h.

Referenced by go_refresh_draw(), and to_set_fb_mode().

#define GED_OBJ_NULL   ((struct ged_obj *)0)

Definition at line 117 of file tclcad.h.

#define TCLCAD_OBJ_NULL   (struct tclcad_obj *)0

Definition at line 126 of file tclcad.h.

Referenced by to_create_cmd(), and to_deleteProc().

Function Documentation

int tclcad_tk_setup ( Tcl_Interp *  interp)
void tclcad_auto_path ( Tcl_Interp *  interp)

Set up the Tcl auto_path for locating various necessary BRL-CAD scripting resources. Detect whether the current invocation is from an installed binary or not and append to the auto_path accordingly for where the needed tclscript resources should be found.

installed invocation paths BRLCAD_ROOT/lib/tclTCL_VERSION/init.tcl BRLCAD_ROOT/lib/tclTK_VERSION/tk.tcl BRLCAD_ROOT/lib/itclITCL_VERSION/itcl.tcl BRLCAD_ROOT/lib/itkITCL_VERSION/itk.tcl BRLCAD_ROOT/lib/iwidgetsIWIDGETS_VERSION/iwidgets.tcl BRLCAD_DATA/tclscripts/pkgIndex.tcl and subdirs

source invocation paths src/other/tcl/library/init.tcl src/other/tk/library/tk.tcl src/other/incrTcl/itcl/library/itcl.tcl src/other/incrTcl/itk/library/itk.tcl src/other/iwidgets/library/iwidgets.tcl src/tclscripts/pkgIndex.tcl and subdirs

if TCLCAD_LIBRARY_PATH is set append to search path get installation directory and invocation path if being run from installation directory add installation paths to search path if being run from source directory add source paths to search path add installation paths to search path

Definition at line 143 of file tclcadAutoPath.c.

References bu_argv0_full_path(), bu_brlcad_data(), bu_brlcad_root(), BU_DIR_SEPARATOR, bu_file_exists(), bu_getprogname(), bu_log(), BU_PATH_SEPARATOR, bu_same_file(), bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_sprintf(), bu_vls_strncat(), bu_which(), data, MAX_BUF, and strtok().

Referenced by Tclcad_Init().

Here is the call graph for this function:

void tclcad_tcl_library ( Tcl_Interp *  interp)
int Tclcad_Init ( Tcl_Interp *  interp)

Definition at line 83 of file tclcad.c.

References Bn_Init(), Bu_Init(), bu_log(), Cho_Init(), Dm_Init(), Fb_Init(), Go_Init(), library_initialized(), Rt_Init(), and tclcad_auto_path().

Here is the call graph for this function:

int Go_Init ( Tcl_Interp *  interp)

create the Tcl command for to_open

Definition at line 1421 of file tclcad_obj.c.

References brlcad_interp, BU_LIST_INIT, dm_list_tcl(), OSL::Strings::interp, tclcad_obj::l, library_initialized(), tclcad_eval_noresult(), and to_open_tcl().

Referenced by Tclcad_Init().

Here is the call graph for this function:

int to_open_tcl ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
const char **  argv 
)

A TCL interface to wdb_fopen() and wdb_dbopen().

Implicit return -
Creates a new TCL proc which responds to get/put/etc. arguments when invoked. clientData of that proc will be ged_obj pointer for this instance of the database. Easily allows keeping track of multiple databases.
Returns
wdb pointer, for more traditional C-style interfacing.
Example -
set top [go_open .inmem inmem $dbip]
.inmem get box.s
.inmem close


go_open db file "bob.g"
db get white.r
db close

Definition at line 1623 of file tclcad_obj.c.

References BU_ALLOC, BU_ASSERT_PTR, bu_hash_tbl_create(), BU_LIST_APPEND, BU_LIST_FOR, BU_LIST_INIT, BU_STR_EQUAL, bu_vls_addr(), bu_vls_init(), bu_vls_strcpy(), ged_drawable::gd_rtCmdNotify, ged::ged_create_vlist_callback, ged::ged_free_vlist_callback, ged::ged_gdp, GED_NULL, ged_open(), ged::ged_output_handler, ged::ged_refresh_handler, ged_obj::go_edited_paths, ged_obj::go_gedp, ged_obj::go_head_views, ged_obj::go_more_args_callback, ged_obj::go_name, ged_obj::go_observers, ged_obj::go_refresh_on, ged_obj::go_rt_end_callback, OSL::Strings::interp, tclcad_obj::l, bu_observer::l, ged_dm_view::l, to_create_cmd(), to_create_vlist_callback(), to_free_vlist_callback(), tclcad_obj::to_gop, tclcad_obj::to_interp, to_output_handler(), to_refresh_handler(), to_rt_end_callback_internal(), and top().

Referenced by Go_Init().

Here is the call graph for this function:

struct application* to_rt_gettrees_application ( struct ged gedp,
int  argc,
const char *  argv[] 
)
void go_refresh ( struct ged_obj gop,
struct ged_dm_view gdvp 
)

Definition at line 14606 of file tclcad_obj.c.

References dm_draw_begin(), dm_draw_end(), dm_get_zbuffer(), dm_set_zbuffer(), ged_dm_view::gdv_dmp, ged_dm_view::gdv_fbs, go_refresh_draw(), and TCLCAD_OBJ_FB_MODE_OFF.

Referenced by to_refresh_view().

Here is the call graph for this function:

void go_refresh_draw ( struct ged_obj gop,
struct ged_dm_view gdvp,
int  restore_zbuffer 
)
int Cho_Init ( Tcl_Interp *  interp)

Definition at line 160 of file cmdhist_obj.c.

int cho_open_tcl ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
const char **  argv 
)

Open a command history object.

USAGE: ch_open name

Definition at line 123 of file cmdhist_obj.c.

References BU_CMDHIST_OBJ_NULL, BU_LIST_FOR, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), cho_cmd(), cho_deleteProc(), bu_cmdhist_obj::cho_name, cho_open(), and bu_cmdhist_obj::l.

Referenced by Cho_Init().

Here is the call graph for this function:

void tclcad_register_cmds ( Tcl_Interp *  interp,
struct bu_cmdtab cmds 
)

This is a convenience routine for registering an array of commands with a Tcl interpreter. Note - this is not intended for use by commands with associated state (i.e. ClientData). The interp is passed to the bu_cmdtab function as clientdata instead of the bu_cmdtab entry.

Parameters
interp- Tcl interpreter wherein to register the commands
cmds- commands and related function pointers
Returns
void

Definition at line 72 of file tclcad.c.

References bu_cmdtab::ct_name.