BRL-CAD
sh_tcl.c File Reference
#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <tcl.h>
#include "bu/parallel.h"
#include "vmath.h"
#include "raytrace.h"
#include "optical.h"
Include dependency graph for sh_tcl.c:

Go to the source code of this file.

Data Structures

struct  tcl_specific
 

Macros

#define tcl_MAGIC   0x54434C00 /* "TCL" */
 
#define CK_tcl_SP(_p)   BU_CKMAG(_p, tcl_MAGIC, "tcl_specific")
 
#define SHDR_NULL   ((struct tcl_specific *)0)
 
#define SHDR_O(m)   bu_offsetof(struct tcl_specific, m)
 
#define rt_Tcl_LV(_s, _v)
 

Functions

HIDDEN int tcl_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int tcl_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void tcl_print (register struct region *rp, void *dp)
 
HIDDEN void tcl_free (void *cp)
 

Variables

struct bu_structparse tcl_print_tab []
 
struct bu_structparse tcl_parse_tab []
 
struct mfuncs tcl_mfuncs []
 

Detailed Description

To add a new shader to the "rt" program's LIBOPTICAL library:

6) Edit shaders.tcl and comb.tcl in the ../tclscripts/mged directory to add a new gui for this shader.

Definition in file sh_tcl.c.

Macro Definition Documentation

#define tcl_MAGIC   0x54434C00 /* "TCL" */

Definition at line 43 of file sh_tcl.c.

#define CK_tcl_SP (   _p)    BU_CKMAG(_p, tcl_MAGIC, "tcl_specific")

Definition at line 44 of file sh_tcl.c.

Referenced by tcl_render().

#define SHDR_NULL   ((struct tcl_specific *)0)

Definition at line 72 of file sh_tcl.c.

#define SHDR_O (   m)    bu_offsetof(struct tcl_specific, m)

Definition at line 73 of file sh_tcl.c.

#define rt_Tcl_LV (   _s,
  _v 
)
Value:
Tcl_LinkVar(tcl_sp->tcl_interp[cpu], _s, (char *)_v, \
TCL_LINK_DOUBLE)

Referenced by tcl_render().

Function Documentation

HIDDEN int tcl_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Definition at line 119 of file sh_tcl.c.

References bn_mat_print(), BU_CK_VLS, BU_GET, bu_log(), bu_struct_parse(), bu_struct_print(), db_region_mat(), MAX_PSW, rdebug, RDEBUG_SHADE, region::reg_name, RT_CHECK_RTI, RT_CK_REGION, rt_uniresource, rt_i::rti_dbip, tcl_specific::tcl_interp, and tcl_specific::tcl_m_to_r.

Here is the call graph for this function:

int tcl_render ( struct application ap,
const struct partition pp,
struct shadework *  swp,
void *  dp 
)

Definition at line 194 of file sh_tcl.c.

References application::a_resource, application::a_x, application::a_y, bu_log(), bu_struct_print(), bu_vls_addr(), CK_tcl_SP, rdebug, RDEBUG_SHADE, resource::re_cpu, rr_render(), RT_AP_CHECK, RT_CHECK_PT, rt_Tcl_LV, tcl_specific::tcl_file, tcl_specific::tcl_interp, tcl_specific::tcl_m_to_r, V3ARGS, X, Y, and Z.

Here is the call graph for this function:

HIDDEN void tcl_print ( register struct region rp,
void *  dp 
)

Definition at line 175 of file sh_tcl.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void tcl_free ( void *  cp)

Definition at line 182 of file sh_tcl.c.

References BU_PUT.

Variable Documentation

struct bu_structparse tcl_print_tab[]
Initial value:
= {
{"%V", 1, "file", SHDR_O(tcl_file), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_tcl.c:73

Definition at line 79 of file sh_tcl.c.

struct bu_structparse tcl_parse_tab[]
Initial value:
= {
{"%p", 1, "tcl_print_tab", bu_byteoffset(tcl_print_tab[0]), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%V", 1, "f", SHDR_O(tcl_file), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
struct bu_structparse tcl_print_tab[]
Definition: sh_tcl.c:79
#define bu_byteoffset(_i)
Definition: parse.h:81
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_tcl.c:73

Definition at line 84 of file sh_tcl.c.

struct mfuncs tcl_mfuncs[]
Initial value:
= {
{MF_MAGIC, "tcl", 0, MFI_NORMAL|MFI_HIT|MFI_UV, 0,
{0, (char *)0, 0, 0, 0,
0, 0, 0, 0 }
}
#define MF_MAGIC
Definition: magic.h:205
HIDDEN void tcl_free(void *cp)
Definition: sh_tcl.c:182
HIDDEN int tcl_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_tcl.c:119
HIDDEN int tcl_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_tcl.c:194
HIDDEN void tcl_print(register struct region *rp, void *dp)
Definition: sh_tcl.c:175

Definition at line 104 of file sh_tcl.c.