BRL-CAD
libbn Tcl interface
Collaboration diagram for libbn Tcl interface:

Files

file  tcl.c
 Tcl interfaces to all the LIBBN math routines.
 

Data Structures

struct  math_func_link
 

Macros

#define MATH_FUNC_VOID_CAST(_func)   ((void (*)(void))_func)
 

Functions

void bn_tcl_setup (Tcl_Interp *interp)
 Tcl interfaces to all the LIBBN math routines. More...
 
int Bn_Init (Tcl_Interp *interp)
 Allows LIBBN to be dynamically loaded to a vanilla tclsh/wish with "load /usr/brlcad/lib/libbn.so". More...
 
void bn_tcl_mat_print (Tcl_Interp *interp, const char *title, const mat_t m)
 
int bn_decode_mat (mat_t m, const char *str)
 Support routines for the math functions. More...
 
int bn_decode_quat (quat_t q, const char *str)
 
int bn_decode_vect (vect_t v, const char *str)
 
int bn_decode_hvect (hvect_t v, const char *str)
 
void bn_encode_mat (struct bu_vls *vp, const mat_t m)
 
void bn_encode_quat (struct bu_vls *vp, const quat_t q)
 
void bn_encode_vect (struct bu_vls *vp, const vect_t v)
 
void bn_encode_hvect (struct bu_vls *vp, const hvect_t v)
 
int bn_decode_mat (fastf_t *mat, const char *str)
 
int bn_decode_quat (fastf_t *quat, const char *str)
 
int bn_decode_vect (fastf_t *vec, const char *str)
 
int bn_decode_hvect (fastf_t *v, const char *str)
 
void bn_encode_quat (struct bu_vls *vp, const mat_t q)
 
void bn_encode_vect (struct bu_vls *vp, const mat_t v)
 
void bn_encode_hvect (struct bu_vls *vp, const mat_t v)
 
void bn_quat_distance_wrapper (double *dp, mat_t q1, mat_t q2)
 
void bn_mat_scale_about_pt_wrapper (int *statusp, mat_t mat, const point_t pt, const double scale)
 
int bn_math_cmd (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
 Tcl wrappers for the math functions. More...
 
int bn_cmd_noise_perlin (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
 
int bn_cmd_noise (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
 
int bn_cmd_noise_slice (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
 usage: noise_slice xdim ydim inv h_val lac octaves dX dY dZ sX [sY sZ] More...
 
int bn_cmd_random (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)
 

Detailed Description

Macro Definition Documentation

#define MATH_FUNC_VOID_CAST (   _func)    ((void (*)(void))_func)

Definition at line 192 of file tcl.c.

Referenced by bn_math_cmd().

Function Documentation

void bn_tcl_setup ( Tcl_Interp *  interp)

Tcl interfaces to all the LIBBN math routines.

Add all the supported Tcl interfaces to LIBBN routines to the list of commands known by the given interpreter.

Definition at line 1009 of file tcl.c.

References bn_cmd_noise(), bn_cmd_noise_perlin(), bn_cmd_noise_slice(), bn_cmd_random(), and bn_math_cmd().

Referenced by Bn_Init().

Here is the call graph for this function:

int Bn_Init ( Tcl_Interp *  interp)

Allows LIBBN to be dynamically loaded to a vanilla tclsh/wish with "load /usr/brlcad/lib/libbn.so".

The name of this function is specified by TCL.

Definition at line 1043 of file tcl.c.

References bn_tcl_setup().

Referenced by Tclcad_Init().

Here is the call graph for this function:

void bn_tcl_mat_print ( Tcl_Interp *  interp,
const char *  title,
const mat_t  m 
)

Definition at line 997 of file tcl.c.

References bn_mat_print_guts().

Here is the call graph for this function:

int bn_decode_mat ( mat_t  m,
const char *  str 
)
int bn_decode_quat ( quat_t  q,
const char *  str 
)
int bn_decode_hvect ( hvect_t  v,
const char *  str 
)
void bn_encode_mat ( struct bu_vls vp,
const mat_t  m 
)

Definition at line 108 of file tcl.c.

References bu_vls_printf(), and bu_vls_putc().

Referenced by bn_math_cmd(), db_tree_list(), ged_model2view(), ged_pmat(), ged_pmodel2view(), ged_rmat(), ged_view2model(), vo_model2view_cmd(), vo_pmat_cmd(), vo_pmodel2view_cmd(), vo_rmat_cmd(), and vo_view2model_cmd().

Here is the call graph for this function:

void bn_encode_quat ( struct bu_vls vp,
const quat_t  q 
)
void bn_encode_hvect ( struct bu_vls vp,
const hvect_t  v 
)
int bn_decode_mat ( fastf_t mat,
const char *  str 
)

Definition at line 51 of file tcl.c.

References BU_STR_EQUAL.

Referenced by bn_math_cmd().

int bn_decode_quat ( fastf_t quat,
const char *  str 
)

Definition at line 73 of file tcl.c.

Referenced by bn_decode_hvect(), and bn_math_cmd().

int bn_decode_vect ( fastf_t vec,
const char *  str 
)

Definition at line 87 of file tcl.c.

References OSL::Strings::v.

Referenced by bn_math_cmd(), and rt_tcl_parse_ray().

int bn_decode_hvect ( fastf_t v,
const char *  str 
)

Definition at line 101 of file tcl.c.

References bn_decode_quat().

Referenced by bn_math_cmd().

Here is the call graph for this function:

void bn_encode_quat ( struct bu_vls vp,
const mat_t  q 
)

Definition at line 124 of file tcl.c.

References bu_vls_printf().

Referenced by bn_math_cmd().

Here is the call graph for this function:

void bn_encode_vect ( struct bu_vls vp,
const mat_t  v 
)

Definition at line 131 of file tcl.c.

References bu_vls_printf().

Referenced by bn_math_cmd(), and rt_tcl_pr_hit().

Here is the call graph for this function:

void bn_encode_hvect ( struct bu_vls vp,
const mat_t  v 
)

Definition at line 138 of file tcl.c.

References bu_vls_printf().

Referenced by bn_math_cmd().

Here is the call graph for this function:

void bn_quat_distance_wrapper ( double *  dp,
mat_t  q1,
mat_t  q2 
)

Definition at line 145 of file tcl.c.

References quat_distance().

Referenced by bn_math_cmd().

Here is the call graph for this function:

void bn_mat_scale_about_pt_wrapper ( int *  statusp,
mat_t  mat,
const point_t  pt,
const double  scale 
)

Definition at line 152 of file tcl.c.

References bn_mat_scale_about_pt().

Referenced by bn_math_cmd().

Here is the call graph for this function:

int bn_math_cmd ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
char **  argv 
)
int bn_cmd_noise_perlin ( ClientData  clientData,
Tcl_Interp *  interp,
int  argc,
char **  argv 
)

Definition at line 770 of file tcl.c.

References bn_noise_perlin(), OSL::Strings::v, X, Y, and Z.

Referenced by bn_tcl_setup().

Here is the call graph for this function:

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

Definition at line 801 of file tcl.c.

References bn_noise_fbm(), bn_noise_turb(), and BU_STR_EQUAL.

Referenced by bn_tcl_setup().

Here is the call graph for this function:

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

usage: noise_slice xdim ydim inv h_val lac octaves dX dY dZ sX [sY sZ]

The idea here is to get a whole slice of noise at once, thereby avoiding the overhead of doing this in Tcl.

Definition at line 852 of file tcl.c.

References bn_noise_fbm(), bn_noise_turb(), BU_STR_EQUAL, delta, NOISE_FBM, NOISE_TURB, VSETALL, X, Y, and Z.

Referenced by bn_tcl_setup().

Here is the call graph for this function:

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

Definition at line 954 of file tcl.c.

References BN_RANDOM.

Referenced by bn_tcl_setup().